Elasticsearch: Fix removing of empty settings from query in backend implementation (#59704)

* Elasticsearch: Fix removing of empty settings from query in backend implementation

* Update

* Update

* Update pkg/tsdb/elasticsearch/time_series_query.go

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
This commit is contained in:
Ivana Huckova
2022-12-05 16:06:55 +01:00
committed by GitHub
parent 3544250baf
commit e356a56741
3 changed files with 12 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ describe('ElasticQueryBuilder', () => {
// The following `missing: null as any` is because previous versions of the DS where
// storing null in the query model when inputting an empty string,
// which were then removed in the query builder.
// The new version doesn't store empty strings at all. This tests ensures backward compatinility.
// The new version doesn't store empty strings at all. This tests ensures backward compatibility.
metrics: [{ type: 'avg', id: '0', settings: { missing: null as any, script: '1' } }],
timeField: '@timestamp',
bucketAggs: [{ type: 'date_histogram', field: '@timestamp', id: '1' }],