Skip to content

Commit 810fd02

Browse files
committed
iter
1 parent 5145707 commit 810fd02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ static TopDocs mergeTopDocs(List<TopDocs> results, int topN, int from) {
150150
return topDocs;
151151
} else if (topDocs instanceof TopFieldGroups firstTopDocs) {
152152
final Sort sort = new Sort(firstTopDocs.fields);
153-
final TopFieldGroups[] shardTopDocs = removeEmptyResults(results).toArray(TopFieldGroups[]::new);
153+
assert results.stream().noneMatch(topDoc -> topDoc == Lucene.EMPTY_TOP_DOCS);
154+
final TopFieldGroups[] shardTopDocs = results.toArray(TopFieldGroups[]::new);
154155
mergedTopDocs = TopFieldGroups.merge(sort, from, topN, shardTopDocs, false);
155156
} else if (topDocs instanceof TopFieldDocs firstTopDocs) {
156157
final Sort sort = checkSameSortTypes(results, firstTopDocs.fields);

0 commit comments

Comments
 (0)