[TEST] fixes InternalTopHitsTests test to initialize the SearchHits
maxScore to Float.NaN if there is no max score, as that is what Lucene's TopDocs does
This commit is contained in:
parent
13489ff3a7
commit
5e54c0261a
|
@ -155,7 +155,8 @@ public class InternalTopHitsTests extends InternalAggregationTestCase<InternalTo
|
|||
for (int i = 0; i < expectedHitsHits.length; i++) {
|
||||
expectedHitsHits[i] = allHits.get(i).v2();
|
||||
}
|
||||
SearchHits expectedHits = new SearchHits(expectedHitsHits, totalHits, maxScore);
|
||||
// Lucene's TopDocs initializes the maxScore to Float.NaN, if there is no maxScore
|
||||
SearchHits expectedHits = new SearchHits(expectedHitsHits, totalHits, maxScore == Float.MIN_VALUE ? Float.NaN : maxScore);
|
||||
assertEqualsWithErrorMessageFromXContent(expectedHits, actualHits);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue