Skip to content

Commit

Permalink
Fix maxScore check in reduce phase when some scores are NaN (#11267) (#…
Browse files Browse the repository at this point in the history
…11268)

(cherry picked from commit 60c46f3)

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 99e9c83 commit a27c35d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ public void testIssue6614() throws ExecutionException, InterruptedException {
}

public void testTrackScores() throws Exception {
assumeFalse(
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/11189",
internalCluster().clusterService().getClusterSettings().get(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING)
);
assertAcked(client().admin().indices().prepareCreate("test").setMapping("svalue", "type=keyword").get());
ensureGreen();
index(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public ReduceableSearchResult reduce(Collection<Collector> collectors) throws IO
float score = collector.getMaxScore();
if (Float.isNaN(maxScore)) {
maxScore = score;
} else {
} else if (!Float.isNaN(score)) {
maxScore = Math.max(maxScore, score);
}
}
Expand Down

0 comments on commit a27c35d

Please sign in to comment.