dsmiley commented on a change in pull request #529:
URL: https://github.com/apache/solr/pull/529#discussion_r798923010



##########
File path: solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.java
##########
@@ -25,18 +25,16 @@
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.ValueSourceScorer;
 import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
 import org.apache.lucene.search.QueryVisitor;
 import org.apache.lucene.search.ScoreMode;
 import org.apache.lucene.search.Weight;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.search.function.ValueSourceRangeFilter;
 
 // This class works as either a normal constant score query, or as a 
PostFilter using a collector
-public class FunctionRangeQuery extends Query implements PostFilter {
+public class FunctionRangeQuery extends ExtendedQueryBase implements 
PostFilter {
 
   final ValueSourceRangeFilter rangeFilt;
-  boolean cache = true; // cache by default
   int cost;

Review comment:
       It's still here along with the other stuff not needed due to 
ExtendedQueryBase

##########
File path: solr/core/src/java/org/apache/solr/query/FilterQuery.java
##########
@@ -89,8 +90,10 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode 
scoreMode, float bo
       return new ConstantScoreQuery(q).createWeight(searcher, scoreMode, 1f);
     }
 
+    SolrIndexSearcher solrSearcher = (SolrIndexSearcher)searcher;
+    DocSet docs = solrSearcher.getDocSet(q);
     // reqInfo.addCloseHook(docs);  // needed for off-heap refcounting
 
-    return new ConstantScoreQuery(q).createWeight(searcher, scoreMode, 1f);
+    return new ConstantScoreQuery(docs.makeQuery()).createWeight(searcher, 
scoreMode, 1f);

Review comment:
       DocSet.makeQuery *is* a constant scoring query, so wrapping in 
ConstantScoreQuery is pointless.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to