private TopDocsCollector <ScoreDoc> DoSearch(int numResults) { Query q = new MatchAllDocsQuery(); IndexSearcher searcher = NewSearcher(Reader); TopDocsCollector <ScoreDoc> tdc = new MyTopsDocCollector(numResults); searcher.Search(q, tdc); return(tdc); }
private TopDocsCollector doSearch(int numResults) { Query q = new MatchAllDocsQuery(); IndexSearcher searcher = new IndexSearcher(dir); TopDocsCollector tdc = new MyTopsDocCollector(numResults); searcher.Search(q, tdc); searcher.Close(); return(tdc); }
public virtual void TestZeroResults() { TopDocsCollector tdc = new MyTopsDocCollector(5); Assert.AreEqual(0, tdc.TopDocs(0, 1).scoreDocs.Length); }
private TopDocsCollector doSearch(int numResults) { Query q = new MatchAllDocsQuery(); IndexSearcher searcher = new IndexSearcher(dir); TopDocsCollector tdc = new MyTopsDocCollector(numResults); searcher.Search(q, tdc); searcher.Close(); return tdc; }
public virtual void TestZeroResults() { TopDocsCollector <ScoreDoc> tdc = new MyTopsDocCollector(5); Assert.AreEqual(0, tdc.GetTopDocs(0, 1).ScoreDocs.Length); }