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
Signed-off-by: Jay Deng <[email protected]>
  • Loading branch information
jed326 authored Nov 20, 2023
1 parent edbc4e2 commit 60c46f3
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 60c46f3

Please sign in to comment.