Don't create nested search source per postflightrequest (#20373)

This commit is contained in:
Tim Roes 2018-07-03 12:52:41 +02:00 committed by GitHub
parent 93d9baafff
commit 59426cbfa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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);
}
}