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,7 +190,12 @@ public class SearchPhaseController {
|
|||
float maxScore = Float.NEGATIVE_INFINITY;
|
||||
for (QuerySearchResultProvider queryResultProvider : queryResults.values()) {
|
||||
totalHits += queryResultProvider.queryResult().topDocs().totalHits;
|
||||
maxScore = Math.max(maxScore, queryResultProvider.queryResult().topDocs().getMaxScore());
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue