File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
server/src/main/java/org/elasticsearch/search/aggregations Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1212import org .elasticsearch .core .Releasable ;
1313import org .elasticsearch .core .Releasables ;
1414
15+ import java .util .ArrayList ;
16+ import java .util .Collection ;
1517import java .util .HashMap ;
18+ import java .util .List ;
1619import java .util .Map ;
1720
1821/**
@@ -54,7 +57,12 @@ public void accept(InternalAggregations aggregations) {
5457 * returns the reduced {@link InternalAggregations}.
5558 */
5659 public InternalAggregations get () {
57- return InternalAggregations .from (aggByName .values ().stream ().map (AggregatorReducer ::get ).toList ());
60+ final Collection <AggregatorReducer > reducers = aggByName .values ();
61+ final List <InternalAggregation > aggs = new ArrayList <>(reducers .size ());
62+ for (AggregatorReducer reducer : reducers ) {
63+ aggs .add (reducer .get ());
64+ }
65+ return InternalAggregations .from (aggs );
5866 }
5967
6068 @ Override
You can’t perform that action at this time.
0 commit comments