You can use the
areDocumentSearchable
method to know whether the last
pushed documents are searchable.
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();
}
}
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);
}
}