jpountz commented on code in PR #13777:
URL: https://github.com/apache/lucene/pull/13777#discussion_r1757465545


##########
lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java:
##########
@@ -254,10 +254,9 @@ protected void updateMinCompetitiveScore(Scorable scorer) 
throws IOException {
         totalHitsRelation = TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO;
         minCompetitiveScore = localMinScore;
         if (minScoreAcc != null) {
-          // we don't use the next float but we register the document
-          // id so that other leaves can require it if they are after
-          // the current maximum
-          minScoreAcc.accumulate(docBase, pqTop.score);
+          // we don't use the next float but we register the document id so 
that other leaves or
+          // leaf partitions can require it if they are after the current 
maximum
+          minScoreAcc.accumulate(docBase + pqTop.doc, pqTop.score);

Review Comment:
   pqTop.doc should already be a top-level doc ID, so adding `docBase`shouldn't 
be needed?



##########
lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java:
##########
@@ -232,7 +232,7 @@ protected void updateGlobalMinCompetitiveScore(Scorable 
scorer) throws IOExcepti
       // the next float if the global minimum score is set on a document id 
that is
       // smaller than the ids in the current leaf
       float score =
-          docBase >= maxMinScore.docBase() ? Math.nextUp(maxMinScore.score()) 
: maxMinScore.score();
+          docBase >= maxMinScore.docId() ? Math.nextUp(maxMinScore.score()) : 
maxMinScore.score();

Review Comment:
   In theory, we could replace this docBase with the current doc ID as well 
(not important for correctness, but could help skip more docs when some 
segments have multiple partitions). I'm good to make this change in a follow-up 
PR instead of this one if it helps.



-- 
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: issues-unsubscr...@lucene.apache.org

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