fix test bug: temporarily allow massive boolean queries

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1672380 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-04-09 14:58:00 +00:00
parent 64ed335455
commit 10c6e948a4
1 changed files with 17 additions and 8 deletions

View File

@ -467,16 +467,25 @@ public class TestTermRangeQuery extends LuceneTestCase {
}
}.checkTerms();
if (random().nextBoolean()) {
q.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_REWRITE);
} else if (random().nextBoolean()) {
q.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_REWRITE);
}
int maxClauseCount = BooleanQuery.getMaxClauseCount();
if (VERBOSE) {
System.out.println("TEST: use rewrite method " + q.getRewriteMethod());
try {
if (random().nextBoolean()) {
q.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_REWRITE);
BooleanQuery.setMaxClauseCount(actualCount);
} else if (random().nextBoolean()) {
q.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_REWRITE);
BooleanQuery.setMaxClauseCount(actualCount);
}
if (VERBOSE) {
System.out.println("TEST: use rewrite method " + q.getRewriteMethod());
}
assertEquals(actualCount, s.search(q, 1).totalHits);
} finally {
BooleanQuery.setMaxClauseCount(maxClauseCount);
}
assertEquals(actualCount, s.search(q, 1).totalHits);
// Test when min == max:
List<String> randomTermsList = new ArrayList<>(randomTerms);