jimczi commented on a change in pull request #897: LUCENE-8978: Maximal Of 
Minimum Scores Based Concurrent Early Termination
URL: https://github.com/apache/lucene-solr/pull/897#discussion_r327588067
 
 

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java
 ##########
 @@ -272,11 +279,24 @@ public ScoreMode scoreMode() {
 
   protected void updateMinCompetitiveScore(Scorable scorer) throws IOException 
{
     if (hitsThresholdChecker.isThresholdReached()
-          && pqTop != null
-          && pqTop.score != Float.NEGATIVE_INFINITY) { // -Infinity is the 
score of sentinels
+          && ((bottomValueChecker != null && 
bottomValueChecker.getBottomValue() > 0)
+          || (pqTop != null && pqTop.score != Float.NEGATIVE_INFINITY))) { // 
-Infinity is the score of sentinels
       // since we tie-break on doc id and collect in doc id order, we can 
require
       // the next float
-      scorer.setMinCompetitiveScore(Math.nextUp(pqTop.score));
+      float bottomScore = Math.nextUp(pqTop.score);
 
 Review comment:
   this will be wrong if `pqTop.score` is filled with a sentinel value ? I 
think you'll need to separate the two conditions (pq is full, global minimum 
score is set) and set the current minimum score accordingly. We should also 
avoid updating the global score if the pq is not full to avoid an unnecessary 
check ?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to