From c7d804ad43b2ee07d66c4b2b1a64c0902c997e7a Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Sat, 9 Oct 2010 12:48:13 +0000 Subject: [PATCH] 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 --- .../test/org/apache/lucene/search/TestBoolean2.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lucene/src/test/org/apache/lucene/search/TestBoolean2.java b/lucene/src/test/org/apache/lucene/search/TestBoolean2.java index aa578ef84fa..30f6a100c4a 100644 --- a/lucene/src/test/org/apache/lucene/search/TestBoolean2.java +++ b/lucene/src/test/org/apache/lucene/search/TestBoolean2.java @@ -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