fix a problem where max_score was NaN if there were no hits from a shard (though there are hits from other shards), it will still be NaN where there are no hits
This commit is contained in:
parent
cf998e2f89
commit
3006183191
|
@ -190,8 +190,13 @@ public class SearchPhaseController {
|
|||
float maxScore = Float.NEGATIVE_INFINITY;
|
||||
for (QuerySearchResultProvider queryResultProvider : queryResults.values()) {
|
||||
totalHits += queryResultProvider.queryResult().topDocs().totalHits;
|
||||
if (!Float.isNaN(queryResultProvider.queryResult().topDocs().getMaxScore())) {
|
||||
maxScore = Math.max(maxScore, queryResultProvider.queryResult().topDocs().getMaxScore());
|
||||
}
|
||||
}
|
||||
if (Float.isInfinite(maxScore)) {
|
||||
maxScore = Float.NaN;
|
||||
}
|
||||
|
||||
// clean the fetch counter
|
||||
for (FetchSearchResultProvider fetchSearchResultProvider : fetchResults.values()) {
|
||||
|
|
Loading…
Reference in New Issue