zacharymorn commented on a change in pull request #2205:
URL: https://github.com/apache/lucene-solr/pull/2205#discussion_r559294059



##########
File path: lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
##########
@@ -257,13 +288,17 @@ public int advance(int target) throws IOException {
             // Advance 'head' as well
             advanceHead(target);
 
-            // Pop the new 'lead' from 'head'
-            moveToNextCandidate(target);
+            if (scoreMode == ScoreMode.TOP_SCORES) {
+              // Update score bounds if necessary so
+              updateMaxScoresIfNecessary(target);
 
-            if (doc == DocIdSetIterator.NO_MORE_DOCS) {
-              return DocIdSetIterator.NO_MORE_DOCS;
+              if (doc == DocIdSetIterator.NO_MORE_DOCS) {

Review comment:
       I just pushed a commit to revert back to the original 
`moveToNextCandidate` abstraction, and handle the non TOP_SCORES mode inside 
that method. I think that really helps to localize / simplify the changes (and 
reduce 1 more branching) a lot!  Please let me know if this looks good to you.




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