Skip to content

Commit 94c6fcf

Browse files
meh gotta sort now
1 parent cdbb9ec commit 94c6fcf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,10 +1423,12 @@ static List<SearchShardIterator> mergeShardsIterators(
14231423
List<SearchShardIterator> localShardIterators,
14241424
List<SearchShardIterator> remoteShardIterators
14251425
) {
1426+
final List<SearchShardIterator> shards;
14261427
if (remoteShardIterators.isEmpty()) {
1427-
return localShardIterators;
1428+
shards = localShardIterators;
1429+
} else {
1430+
shards = CollectionUtils.concatLists(remoteShardIterators, localShardIterators);
14281431
}
1429-
final List<SearchShardIterator> shards = CollectionUtils.concatLists(remoteShardIterators, localShardIterators);
14301432
shards.sort(SearchShardIterator::compareTo);
14311433
return shards;
14321434
}

0 commit comments

Comments
 (0)