jimczi commented on a change in pull request #431:
URL: https://github.com/apache/lucene/pull/431#discussion_r745505567
##########
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:
Thanks for clarifying and adding the comment @jpountz
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]