Re: [PR] SOLR-18016: Fix spatial distance sorting with SRPT and filter cache [solr]

2025-12-11 Thread via GitHub


dsmiley commented on PR #3935:
URL: https://github.com/apache/solr/pull/3935#issuecomment-3642118188

   fully backported now.  I had to do a little change I'm not proud of on 9x:
   ```
   // In Lucene 10, this method isn't even here anymore.  This utility 
class is used in such
   // a limited way that we seem to get away with not implementing the 
method properly.
   @Override
   public int docID() {
 throw new IllegalStateException("unexpected");
   }
   ```


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



Re: [PR] SOLR-18016: Fix spatial distance sorting with SRPT and filter cache [solr]

2025-12-10 Thread via GitHub


dsmiley commented on PR #3935:
URL: https://github.com/apache/solr/pull/3935#issuecomment-3638505147

   There is no bug to be fixed in Lucene, but I mentioned contributing a 
"reverse" option on LatLonPointSortField which would be easy


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



Re: [PR] SOLR-18016: Fix spatial distance sorting with SRPT and filter cache [solr]

2025-12-10 Thread via GitHub


dsmiley merged PR #3935:
URL: https://github.com/apache/solr/pull/3935


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



Re: [PR] SOLR-18016: Fix spatial distance sorting with SRPT and filter cache [solr]

2025-12-09 Thread via GitHub


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]