You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/11/08 21:54:38 UTC

[GitHub] [lucene] jimczi commented on a change in pull request #431: LUCENE-10208: Ensure that the minimum competitive score does not decrease in concurrent search

jimczi commented on a change in pull request #431:
URL: https://github.com/apache/lucene/pull/431#discussion_r745122136



##########
File path: lucene/core/src/java/org/apache/lucene/search/MaxScoreAccumulator.java
##########
@@ -35,9 +35,22 @@
     this.modInterval = DEFAULT_INTERVAL;
   }
 
-  void accumulate(int docID, float score) {
-    assert docID >= 0 && score >= 0;
-    long encode = (((long) Float.floatToIntBits(score)) << 32) | docID;
+  private static long maxBinary(long v1, long v2) {
+    float score1 = Float.intBitsToFloat((int) (v1 >> 32));
+    float score2 = Float.intBitsToFloat((int) (v2 >> 32));
+    int cmp = Float.compare(score1, score2);
+    if (cmp == 0) {
+      // tie-break on the minimum doc base
+      return (int) v1 < (int) v2 ? v1 : v2;

Review comment:
       Sort of yes, we track the maximum score and in case of a tie we want to keep the minimum doc base and not the maximum as previously implemented.




-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org