diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index e0573bf5e22..1e6b53ce25a 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -344,7 +344,6 @@ export class ElasticDatasource extends DataSourceApi): Promise { - console.log('optinos', options); let payload = ''; const targets = _.cloneDeep(options.targets); const sentTargets: ElasticsearchQuery[] = []; @@ -412,8 +411,6 @@ export class ElasticDatasource extends DataSourceApi target.metrics.some(metric => metric.type === 'raw_document_v2'))) { - return er.getTimeSeries(true); } return er.getTimeSeries(); diff --git a/public/app/plugins/datasource/elasticsearch/elastic_response.ts b/public/app/plugins/datasource/elasticsearch/elastic_response.ts index 035902a3783..c690cf8491a 100644 --- a/public/app/plugins/datasource/elasticsearch/elastic_response.ts +++ b/public/app/plugins/datasource/elasticsearch/elastic_response.ts @@ -390,8 +390,8 @@ export class ElasticResponse { return result; } - getTimeSeries(processToDataFrames = false): DataQueryResponse { - if (processToDataFrames) { + getTimeSeries(): DataQueryResponse { + if (this.targets.some(target => target.metrics.some(metric => metric.type === 'raw_document_v2'))) { return this.processResponseToDataFrames(false); } return this.processResponseToSeries(); diff --git a/public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts b/public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts index 1b94965ceb4..6ce182e1903 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts @@ -92,25 +92,25 @@ describe('ElasticQueryDef', () => { describe('pipeline aggs depending on esverison', () => { describe('using esversion undefined', () => { test('should not get pipeline aggs', () => { - expect(queryDef.getMetricAggTypes(undefined).length).toBe(10); + expect(queryDef.getMetricAggTypes(undefined).length).toBe(11); }); }); describe('using esversion 1', () => { test('should not get pipeline aggs', () => { - expect(queryDef.getMetricAggTypes(1).length).toBe(10); + expect(queryDef.getMetricAggTypes(1).length).toBe(11); }); }); describe('using esversion 2', () => { test('should get pipeline aggs', () => { - expect(queryDef.getMetricAggTypes(2).length).toBe(14); + expect(queryDef.getMetricAggTypes(2).length).toBe(15); }); }); describe('using esversion 5', () => { test('should get pipeline aggs', () => { - expect(queryDef.getMetricAggTypes(5).length).toBe(14); + expect(queryDef.getMetricAggTypes(5).length).toBe(15); }); }); });