Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
import org.elasticsearch.core.Releasable;
import org.elasticsearch.core.Releasables;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
Expand Down Expand Up @@ -54,7 +57,12 @@ public void accept(InternalAggregations aggregations) {
* returns the reduced {@link InternalAggregations}.
*/
public InternalAggregations get() {
return InternalAggregations.from(aggByName.values().stream().map(AggregatorReducer::get).toList());
final Collection<AggregatorReducer> reducers = aggByName.values();
final List<InternalAggregation> aggs = new ArrayList<>(reducers.size());
for (AggregatorReducer reducer : reducers) {
aggs.add(reducer.get());
}
return InternalAggregations.from(aggs);
}

@Override
Expand Down