Skip to content

Commit 60c46f3

Browse files
authored
Fix maxScore check in reduce phase when some scores are NaN (#11267)
Signed-off-by: Jay Deng <jayd0104@gmail.com>
1 parent edbc4e2 commit 60c46f3

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

server/src/internalClusterTest/java/org/opensearch/search/sort/FieldSortIT.java

-4
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,6 @@ public void testIssue6614() throws ExecutionException, InterruptedException {
268268
}
269269

270270
public void testTrackScores() throws Exception {
271-
assumeFalse(
272-
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/11189",
273-
internalCluster().clusterService().getClusterSettings().get(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING)
274-
);
275271
assertAcked(client().admin().indices().prepareCreate("test").setMapping("svalue", "type=keyword").get());
276272
ensureGreen();
277273
index(

server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public ReduceableSearchResult reduce(Collection<Collector> collectors) throws IO
532532
float score = collector.getMaxScore();
533533
if (Float.isNaN(maxScore)) {
534534
maxScore = score;
535-
} else {
535+
} else if (!Float.isNaN(score)) {
536536
maxScore = Math.max(maxScore, score);
537537
}
538538
}

0 commit comments

Comments
 (0)