Index: TestBoolean2.java =================================================================== --- TestBoolean2.java (revision 154651) +++ TestBoolean2.java (working copy) @@ -66,14 +66,19 @@ //System.out.println(); //System.out.println("Query: " + queryText); Query query1 = makeQuery(queryText); - BooleanQuery.setUseScorer14(true); - Hits hits1 = searcher.search(query1); + BooleanQuery.setUseScorer14(true, true); + + try { + Hits hits1 = searcher.search(query1); + Query query2 = makeQuery(queryText); // there should be no need to parse again... - Query query2 = makeQuery(queryText); // there should be no need to parse again... - BooleanQuery.setUseScorer14(false); - Hits hits2 = searcher.search(query2); + BooleanQuery.setUseScorer14(false, false); + Hits hits2 = searcher.search(query2); - CheckHits.checkHitsQuery(query2, hits1, hits2, expDocNrs, this); + CheckHits.checkHitsQuery(query2, hits1, hits2, expDocNrs, this); + } finally { // always reset the static booleans in BooleanQuery: + BooleanQuery.setUseScorer14(false, false); + } } public void testQueries01() throws Exception { @@ -130,10 +135,10 @@ queriesTest(queryText, expDocNrs); } - public void testQueries10() throws Exception { + public void testQueries10() throws Exception { String queryText = "+w3 +xx +w2 zz"; int[] expDocNrs = {2, 3}; - searcher.setSimilarity(new DefaultSimilarity(){ + searcher.setSimilarity(new DefaultSimilarity() { public float coord(int overlap, int maxOverlap) { return overlap / ((float)maxOverlap - 1); }