Пример #1
0
        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);
        }
Пример #3
0
		public virtual void  TestZeroResults()
		{
			TopDocsCollector tdc = new MyTopsDocCollector(5);
			Assert.AreEqual(0, tdc.TopDocs(0, 1).scoreDocs.Length);
		}
Пример #4
0
		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;
		}
Пример #5
0
        public virtual void TestZeroResults()
        {
            TopDocsCollector <ScoreDoc> tdc = new MyTopsDocCollector(5);

            Assert.AreEqual(0, tdc.GetTopDocs(0, 1).ScoreDocs.Length);
        }