Skip to content

Commit ca80ec2

Browse files
fix test
1 parent 73ee949 commit ca80ec2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ private static InternalAggregations aggregate(
390390
int resultSetSize,
391391
AggregationReduceContext reduceContext
392392
) {
393+
if (resultSetSize == 0) {
394+
return null;
395+
}
393396
if (resultSetSize == 1) {
394397
if (partialResults.hasNext()) {
395398
return InternalAggregations.reduce(partialResults.next(), reduceContext);

0 commit comments

Comments
 (0)