diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index 408f1d4ce95..e3815bd9e6e 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -35,7 +35,6 @@ import { import { bucketAggregationConfig } from './components/QueryEditor/BucketAggregationsEditor/utils'; import { BucketAggregation, - BucketAggregationWithField, isBucketAggregationWithField, } from './components/QueryEditor/BucketAggregationsEditor/aggregations'; import { generate, Observable, of, throwError } from 'rxjs'; @@ -391,23 +390,7 @@ export class ElasticDatasource extends DataSourceApi ({ - ...q, - bucketAggs: q.bucketAggs?.map((bucketAgg, aggIndex) => { - if (isBucketAggregationWithField(bucketAgg)) { - return { - ...bucketAgg, - field: (queries[queryIndex].bucketAggs?.[aggIndex] as BucketAggregationWithField).field, - }; - } - - return bucketAgg; - }), - })); + return finalQueries; } testDatasource() {