IndexReader reader = IndexReader.open(dir, false);
Term aaa = new Term("content", "aaa");
Term bbb = new Term("content", "bbb");
Term ccc = new Term("content", "ccc");
assertEquals(37, reader.docFreq(ccc));
reader.deleteDocument(0);
assertEquals(37, reader.docFreq(aaa));
dir.tweakBufferSizes();
reader.deleteDocument(4);
assertEquals(reader.docFreq(bbb), 37);