Skip to content

Commit

Permalink
Don't create nested search source per postflightrequest (elastic#20373)
Browse files Browse the repository at this point in the history
  • Loading branch information
timroes committed Jul 3, 2018
1 parent a954f44 commit c36a0b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/ui/public/agg_types/buckets/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export const termsBucketAgg = new BucketAggType({
};
},
createFilter: createFilterTerms,
postFlightRequest: async (resp, aggConfigs, aggConfig, nestedSearchSource) => {
postFlightRequest: async (resp, aggConfigs, aggConfig, searchSource) => {
const nestedSearchSource = searchSource.makeChild();
if (aggConfig.params.otherBucket) {
const filterAgg = buildOtherBucketAgg(aggConfigs, aggConfig, resp);
nestedSearchSource.set('aggs', filterAgg);
Expand Down
3 changes: 1 addition & 2 deletions src/ui/public/vis/request_handlers/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ const CourierRequestHandlerProvider = function () {
}).then(async resp => {
for (const agg of aggs) {
if (_.has(agg, 'type.postFlightRequest')) {
const nestedSearchSource = requestSearchSource.makeChild();
resp = await agg.type.postFlightRequest(resp, aggs, agg, nestedSearchSource);
resp = await agg.type.postFlightRequest(resp, aggs, agg, requestSearchSource);
}
}

Expand Down

0 comments on commit c36a0b7

Please sign in to comment.