Apache Solr open-source search software
expand test to show BQ skipping limit the number of times a nested func is called
Chris M. Hostetterbbd4f58af568
diff --git a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java b/solr/core/src/test/org/apache/solr/core/SOLR749Test.javaindex 403c0cc2f3f..d1d0b315636 100644--- a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java+++ b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java@@ -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();}