From a97259f07ddf5c693356e27e1ae6f4447a9263bb Mon Sep 17 00:00:00 2001 From: Giordano Ricci Date: Sat, 26 Jun 2021 18:37:44 +0100 Subject: [PATCH] Elasticsearch: Name fields after template variables values instead of their name (#36035) This reverts commit 185bf8f9a23e37c7fd521ea8dc3de44aace5fc77. --- .../datasource/elasticsearch/datasource.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) 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() {