public void TestDocFreq() { RAMDirectory dir1 = new RAMDirectory(); RAMDirectory dir2 = new RAMDirectory(); InitIndex(dir1, 10, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc... InitIndex(dir2, 5, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc... IndexSearcher searcher1 = new IndexSearcher(dir1, true); IndexSearcher searcher2 = new IndexSearcher(dir2, true); MultiSearcher multiSearcher = GetMultiSearcherInstance(new Searcher[] { searcher1, searcher2 }); Assert.AreEqual(15, multiSearcher.DocFreq(new Term("contents", "x"))); }