dsmiley commented on code in PR #3935:
URL: https://github.com/apache/solr/pull/3935#discussion_r2604972286


##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -2703,4 +2703,12 @@ public void initializeMetrics(SolrMetricsContext 
solrMetricsContext, Attributes
   public long getWarmupTime() {
     return warmupTime;
   }
+
+  private static final Scorable CONSTANT_SCORABLE =
+      new Scorable() {
+        @Override
+        public float score() throws IOException {
+          return 1f;

Review Comment:
   this is not even called, by the way



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -2703,4 +2703,12 @@ public void initializeMetrics(SolrMetricsContext 
solrMetricsContext, Attributes
   public long getWarmupTime() {
     return warmupTime;
   }
+
+  private static final Scorable CONSTANT_SCORABLE =

Review Comment:
   I know we generally put fields at the top but I chose the bottom as it's a 
trivial distraction.  However, I will move this to the top if asked!



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -2381,7 +2381,7 @@ protected void sortDocSet(QueryResult qr, QueryCommand 
cmd) throws IOException {
         base = leaf.docBase;
         end = base + leaf.reader().maxDoc();
         leafCollector = topCollector.getLeafCollector(leaf);
-        // we should never need to set the scorer given the settings for the 
collector
+        leafCollector.setScorer(CONSTANT_SCORABLE);

Review Comment:
   this is not expensive.  I believe Yonik avoided it in part because it was 
more annoying to do something like this back then.  In Lucene 9, Scorable is 
quite minimal.



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