Elasticsearch: Fix ad-hoc filter support for Raw Data query and new table panel (#28064)

pull/28074/head^2
Giordano Ricci 5 years ago committed by GitHub
parent f46694479f
commit 09574547b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      public/app/plugins/datasource/elasticsearch/elastic_response.ts
  2. 41
      public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts

@ -580,6 +580,9 @@ const createEmptyDataFrame = (
const series = new MutableDataFrame({ fields: [] });
series.addField({
config: {
filterable: true,
},
name: timeField,
type: FieldType.time,
});
@ -615,6 +618,9 @@ const createEmptyDataFrame = (
}
series.addField({
config: {
filterable: true,
},
name: propName,
type: FieldType.string,
}).parse = (v: any) => {

@ -1152,6 +1152,47 @@ describe('ElasticResponse', () => {
});
});
describe('Raw Data Query', () => {
beforeEach(() => {
targets = [
{
refId: 'A',
metrics: [{ type: 'raw_data', id: '1' }],
bucketAggs: [],
},
];
response = {
responses: [
{
hits: {
total: {
relation: 'eq',
value: 1,
},
hits: [
{
_id: '1',
_type: '_doc',
_index: 'index',
_source: { sourceProp: 'asd' },
},
],
},
},
],
};
result = new ElasticResponse(targets, response).getTimeSeries();
});
it('should create dataframes with filterable fields', () => {
for (const field of result.data[0].fields) {
expect(field.config.filterable).toBe(true);
}
});
});
describe('simple logs query and count', () => {
const targets: any = [
{

Loading…
Cancel
Save