Lucene.Net.Search.CheckHits.CheckHitsQuery C# (CSharp) Method

CheckHitsQuery() public static method

Tests that two queries have an expected order of documents, and that the two queries have the same score values.
public static CheckHitsQuery ( Query query, Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2, int results ) : void
query Query
hits1 Lucene.Net.Search.ScoreDoc
hits2 Lucene.Net.Search.ScoreDoc
results int
return void
        public static void CheckHitsQuery(Query query, ScoreDoc[] hits1, ScoreDoc[] hits2, int[] results)
        {
            CheckDocIds("hits1", results, hits1);
            CheckDocIds("hits2", results, hits2);
            CheckEqual(query, hits1, hits2);
        }

Usage Example

コード例 #1
0
ファイル: TestBoolean2.cs プロジェクト: segovia/lucenenet
        public virtual void QueriesTest(Query query, int[] expDocNrs)
        {
            TopScoreDocCollector collector = TopScoreDocCollector.Create(1000, false);

            Searcher.Search(query, null, collector);
            ScoreDoc[] hits1 = collector.GetTopDocs().ScoreDocs;

            collector = TopScoreDocCollector.Create(1000, true);
            Searcher.Search(query, null, collector);
            ScoreDoc[] hits2 = collector.GetTopDocs().ScoreDocs;

            Assert.AreEqual(MulFactor * collector.TotalHits, BigSearcher.Search(query, 1).TotalHits);

            CheckHits.CheckHitsQuery(query, hits1, hits2, expDocNrs);
        }
All Usage Examples Of Lucene.Net.Search.CheckHits::CheckHitsQuery