public virtual void TestMaxBufferedDeletes() { Directory dir = new MockRAMDirectory(); IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED, null); writer.SetMaxBufferedDeleteTerms(1); writer.DeleteDocuments(null, new Term("foobar", "1")); writer.DeleteDocuments(null, new Term("foobar", "1")); writer.DeleteDocuments(null, new Term("foobar", "1")); Assert.AreEqual(3, writer.GetFlushDeletesCount()); writer.Close(); dir.Close(); }
public virtual void TestMaxBufferedDeletes() { for (int pass = 0; pass < 2; pass++) { bool autoCommit = (0 == pass); Directory dir = new MockRAMDirectory(); IndexWriter writer = new IndexWriter(dir, autoCommit, new WhitespaceAnalyzer(), true); writer.SetMaxBufferedDeleteTerms(1); writer.DeleteDocuments(new Term("foobar", "1")); writer.DeleteDocuments(new Term("foobar", "1")); writer.DeleteDocuments(new Term("foobar", "1")); Assert.AreEqual(3, writer.GetFlushDeletesCount()); writer.Close(); dir.Close(); } }
public virtual void TestMaxBufferedDeletes() { Directory dir = new MockRAMDirectory(); IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED); writer.SetMaxBufferedDeleteTerms(1); writer.DeleteDocuments(new Term("foobar", "1")); writer.DeleteDocuments(new Term("foobar", "1")); writer.DeleteDocuments(new Term("foobar", "1")); Assert.AreEqual(3, writer.GetFlushDeletesCount()); writer.Close(); dir.Close(); }