madrob commented on a change in pull request #1992:
URL: https://github.com/apache/lucene-solr/pull/1992#discussion_r540707440



##########
File path: 
solr/core/src/java/org/apache/solr/search/facet/FacetRangeProcessor.java
##########
@@ -531,7 +533,20 @@ private  SimpleOrderedMap getRangeCountsIndexed() throws 
IOException {
   private Query[] filters;
   private DocSet[] intersections;
   private void rangeStats(Range range, int slot) throws IOException {
-    Query rangeQ = sf.getType().getRangeQuery(null, sf, range.low == null ? 
null : calc.formatValue(range.low), range.high==null ? null : 
calc.formatValue(range.high), range.includeLower, range.includeUpper);
+    final Query rangeQ;
+    {
+      final Query rangeQuery = sf.getType().getRangeQuery(null, sf, range.low 
== null ? null : calc.formatValue(range.low), range.high==null ? null : 
calc.formatValue(range.high), range.includeLower, range.includeUpper);
+      if (fcontext.cache) {
+        rangeQ = rangeQuery;
+      } else if (rangeQuery instanceof ExtendedQuery) {
+        ((ExtendedQuery) rangeQuery).setCache(fcontext.cache);

Review comment:
       Here (and in the else) I think I would explicitly do `setCache(false)` 
as it feels more readable to me, but I don't have strong opinions on that.

##########
File path: 
solr/core/src/test/org/apache/solr/search/facet/TestJsonRangeFacets.java
##########
@@ -41,6 +42,7 @@ public static void beforeTests() throws Exception {
     if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) 
System.setProperty(NUMERIC_DOCVALUES_SYSPROP,"true");
 
     initCore("solrconfig-tlog.xml","schema_latest.xml");
+    cache = random().nextBoolean();

Review comment:
       Might as well store the string directly?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to