}
@Test
public void testBlurIndexWriterFaster() throws IOException, InterruptedException {
setupWriter(configuration, 100, false);
IndexSearcherClosable searcher1 = writer.getIndexReader();
IndexReader reader1 = searcher1.getIndexReader();
assertEquals(0, reader1.numDocs());
searcher1.close();
long s = System.nanoTime();
int total = 0;
for (int i = 0; i < TEST_NUMBER; i++) {
if (i == TEST_NUMBER - 1) {
writer.replaceRow(true, true, genRow());
} else {
writer.replaceRow(false, true, genRow());
}
total++;
}
long e = System.nanoTime();
double seconds = (e - s) / 1000000000.0;
double rate = total / seconds;
System.out.println("Rate " + rate);
// //wait one second for the data to become visible the test is set to
// refresh once every 25 ms
// Thread.sleep(1000);
writer.refresh();
IndexSearcherClosable searcher2 = writer.getIndexReader();
IndexReader reader2 = searcher2.getIndexReader();
assertEquals(TEST_NUMBER, reader2.numDocs());
searcher2.close();
}