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:
Jim Ferenczi 2017-02-21 18:18:44 +01:00
parent 5e4ba4a60e
commit 1ba9770037
1 changed files with 1 additions and 1 deletions

View File

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