}
protected void waitUntilQueueEmpty() throws Exception
{
SearchIndex index = (SearchIndex)getQueryHandler();
IndexingQueue queue = index.getIndex().getIndexingQueue();
index.getIndex().flush();
synchronized (index.getIndex())
{
while (queue.getNumPendingDocuments() > 0)
{
index.getIndex().wait(50);
}
}
}