Programmer : Connector Programmer : Using the Push API Client : Monitoring the Index
 
Monitoring the Index
You can use the areDocumentSearchable method to know whether the last pushed documents are searchable.
Example 15. Java Code
static void waitForDocumentsAreSearchable() throws PushAPIException {
// get the serial that can be used to track processing status of documents
final BigInteger serial = papi.setCheckpoint("no value", "foo");

// trigger indexing job
papi.triggerIndexingJob();

// wait for documents searchable
try {
while (!papi.areDocumentsSearchable(serial)) {
Thread.sleep(1000);
}
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
Example 16. C# Code
static void WaitForDocumentsAreSearchable()
{
// get the serial that can be used to track processing status of documents
ulong serial = papi.SetCheckpoint("no value", "foo");

// trigger indexing job
papi.TriggerIndexingJob();

// wait for documents searchable
while (!papi.AreDocumentsSearchable(serial)) {
Thread.Sleep(1000);
}
}