@Test
public void testSmallDocs() throws IOException {
RAMDirectory directory = new RAMDirectory();
IndexWriterConfig conf1 = new IndexWriterConfig(Version.LUCENE_43, new WhitespaceAnalyzer(Version.LUCENE_43));
conf1.setCodec(new Blur022Codec());
Random random1 = new Random(1);
IndexWriter writer1 = new IndexWriter(directory, conf1);
for (int i = 0; i < 1000; i++) {
writer1.addDocument(getSmallDoc(random1));
}
writer1.close();
DirectoryReader reader1 = DirectoryReader.open(directory);
int numDocs1 = reader1.numDocs();
assertEquals(1000, numDocs1);
// for (int i = 0; i < numDocs1; i++) {
// System.out.println(reader1.document(i));
// }
IndexWriterConfig conf2 = new IndexWriterConfig(Version.LUCENE_43, new WhitespaceAnalyzer(Version.LUCENE_43));
conf2.setCodec(new Blur022Codec(1 << 16, CompressionMode.HIGH_COMPRESSION));
Random random2 = new Random(1);
IndexWriter writer2 = new IndexWriter(directory, conf2);
for (int i = 0; i < 1000; i++) {
writer2.addDocument(getSmallDoc(random2));