mirror of https://github.com/apache/lucene.git
don't double-parse query text in this test
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1006146 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
287d27b605
commit
c7d804ad43
|
@ -128,20 +128,19 @@ public class TestBoolean2 extends LuceneTestCase {
|
|||
//System.out.println();
|
||||
//System.out.println("Query: " + queryText);
|
||||
|
||||
Query query1 = makeQuery(queryText);
|
||||
Query query = makeQuery(queryText);
|
||||
TopScoreDocCollector collector = TopScoreDocCollector.create(1000, false);
|
||||
searcher.search(query1, null, collector);
|
||||
searcher.search(query, null, collector);
|
||||
ScoreDoc[] hits1 = collector.topDocs().scoreDocs;
|
||||
|
||||
Query query2 = makeQuery(queryText); // there should be no need to parse again...
|
||||
|
||||
collector = TopScoreDocCollector.create(1000, true);
|
||||
searcher.search(query2, null, collector);
|
||||
searcher.search(query, null, collector);
|
||||
ScoreDoc[] hits2 = collector.topDocs().scoreDocs;
|
||||
|
||||
assertEquals(mulFactor * collector.totalHits,
|
||||
bigSearcher.search(query1, 1).totalHits);
|
||||
bigSearcher.search(query, 1).totalHits);
|
||||
|
||||
CheckHits.checkHitsQuery(query2, hits1, hits2, expDocNrs);
|
||||
CheckHits.checkHitsQuery(query, hits1, hits2, expDocNrs);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue