jpountz commented on a change in pull request #904: LUCENE-8992: Share minimum 
score across segment in concurrent search
URL: https://github.com/apache/lucene-solr/pull/904#discussion_r333550816
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java
 ##########
 @@ -318,19 +350,41 @@ private TopFieldCollector(FieldValueHitQueue<Entry> pq, 
int numHits,
       scoreMode = needsScores ? ScoreMode.COMPLETE : 
ScoreMode.COMPLETE_NO_SCORES;
       canSetMinScore = false;
     }
+    this.minScoreAcc = minScoreAcc;
   }
 
   @Override
   public ScoreMode scoreMode() {
     return scoreMode;
   }
 
+  protected void updateGlobalMinCompetitiveScore(Scorable scorer) throws 
IOException {
+    assert minScoreAcc != null;
+    if (canSetMinScore
+          && hitsThresholdChecker.isThresholdReached()) {
+      MaxScoreAccumulator.Result maxMinScore = minScoreAcc.get();
+      if (maxMinScore != null && maxMinScore.score > minCompetitiveScore) {
+        scorer.setMinCompetitiveScore(maxMinScore.score);
+        minCompetitiveScore = maxMinScore.score;
+        totalHitsRelation = TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO;
+      }
+    }
+  }
+
   protected void updateMinCompetitiveScore(Scorable scorer) throws IOException 
{
-    if (canSetMinScore && hitsThresholdChecker.isThresholdReached() && 
queueFull) {
+    if (canSetMinScore
+          && hitsThresholdChecker.isThresholdReached()
+          && queueFull) {
 
 Review comment:
   shouldn't we be able to use min competitive scores from other threads even 
if our own queue is not full yet?

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