mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Fix comparaison of double in InternalTopHits
InternalTopHits uses "==" to compare hit scores and fails when score is NaN. This commit changes the comparaison to always use Double.compare. Relates #23253
This commit is contained in:
parent
5e4ba4a60e
commit
1ba9770037
@ -173,7 +173,7 @@ public class InternalTopHits extends InternalMetricsAggregation implements TopHi
|
||||
ScoreDoc thisDoc = topDocs.scoreDocs[d];
|
||||
ScoreDoc otherDoc = other.topDocs.scoreDocs[d];
|
||||
if (thisDoc.doc != otherDoc.doc) return false;
|
||||
if (thisDoc.score != otherDoc.score) return false;
|
||||
if (Double.compare(thisDoc.score, otherDoc.score) != 0) return false;
|
||||
if (thisDoc.shardIndex != otherDoc.shardIndex) return false;
|
||||
if (thisDoc instanceof FieldDoc) {
|
||||
if (false == (otherDoc instanceof FieldDoc)) return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user