From bbd4f58af5686abb7580db19b7762bc1bcfa6fe0 Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Tue, 24 Jun 2014 01:16:57 +0000 Subject: [PATCH] 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 --- .../src/test/org/apache/solr/core/SOLR749Test.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java index 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(); }