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

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java
 ##########
 @@ -277,31 +288,44 @@ public ScoreMode scoreMode() {
     return hitsThresholdChecker.scoreMode();
   }
 
+  public boolean isQueueFull() {
+    return pqTop != null && pqTop.score != Float.NEGATIVE_INFINITY;
+  }
+
   protected void updateMinCompetitiveScore(Scorable scorer) throws IOException 
{
-    if (hitsThresholdChecker.isThresholdReached()
-          && ((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
-      float bottomScore = Float.NEGATIVE_INFINITY;
-
-      if (pqTop != null && pqTop.score != Float.NEGATIVE_INFINITY) {
-        bottomScore = Math.nextUp(pqTop.score);
-
-        if (bottomValueChecker != null) {
-          bottomValueChecker.updateThreadLocalBottomValue(pqTop.score);
+    if (hitsThresholdChecker.isThresholdReached()) {
+      boolean hasChanged = false;
+      if (isQueueFull()) {
+        // since we tie-break on doc id and collect in doc id order, we can 
require
+        // the next float
+        float localMinScore = Math.nextUp(pqTop.score);
+        if (localMinScore > minCompetitiveScore) {
+          hasChanged = true;
+          minCompetitiveScore = localMinScore;
+          if (bottomValueChecker != null) {
 
 Review comment:
   I am not sure about the benefit of this refactoring : seems like it is still 
checking if the local scorer's minimum score can be improved by either pqTop's 
score or the global minimum score, which is what was being done earlier? Could 
you describe the idea behind this refactoring, please?

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