expand test to show BQ skipping limit the number of times a nested func is called

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1604990 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2014-06-24 01:16:57 +00:00
parent 665fc4df87
commit bbd4f58af5
1 changed files with 10 additions and 0 deletions

View File

@ -74,6 +74,16 @@ public class SOLR749Test extends SolrTestCaseJ4 {
"//result[@numFound=20]");
assertEquals(20, CountUsageValueSourceParser.getAndClearCount("func_q_wrapping_fq"));
assertQ("frange in complex bq w/ other mandatory clauses to check skipping",
req("q","{!notfoo}(+id:[20 TO 39] -id:25 +{!frange l=4.5 u=4.5 v='countUsage(frange_in_bq,4.5)'})"),
"//result[@numFound=19]");
// don't assume specific clause evaluation ordering.
// ideally this is 19, but could be as high as 20 depending on wether frange's
// scorer has next() called on it before other clauses skipTo
int count = CountUsageValueSourceParser.getAndClearCount("frange_in_bq");
assertTrue("frange_in_bq: " + count, (19 <= count && count <= 20));
} finally {
CountUsageValueSourceParser.clearCounters();
}