mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
ES: return .raw fields in field lookups, closes #8975
This commit is contained in:
parent
a5d5f3d82f
commit
a5bdfec0de
@ -272,10 +272,17 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
|
|||||||
var subObj = obj[key];
|
var subObj = obj[key];
|
||||||
|
|
||||||
// Check mapping field for nested fields
|
// Check mapping field for nested fields
|
||||||
if (subObj.hasOwnProperty('properties')) {
|
if (_.isObject(subObj.properties)) {
|
||||||
fieldNameParts.push(key);
|
fieldNameParts.push(key);
|
||||||
getFieldsRecursively(subObj.properties);
|
getFieldsRecursively(subObj.properties);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (_.isObject(subObj.fields)) {
|
||||||
|
fieldNameParts.push(key);
|
||||||
|
getFieldsRecursively(subObj.fields);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_.isString(subObj.type)) {
|
||||||
var fieldName = fieldNameParts.concat(key).join('.');
|
var fieldName = fieldNameParts.concat(key).join('.');
|
||||||
|
|
||||||
// Hide meta-fields and check field type
|
// Hide meta-fields and check field type
|
||||||
|
@ -129,7 +129,10 @@ describe('ElasticDatasource', function() {
|
|||||||
'@timestamp': {type: 'date'},
|
'@timestamp': {type: 'date'},
|
||||||
beat: {
|
beat: {
|
||||||
properties: {
|
properties: {
|
||||||
name: {type: 'string'},
|
name: {
|
||||||
|
fields: {raw: {type: 'keyword'}},
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
hostname: {type: 'string'},
|
hostname: {type: 'string'},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -169,6 +172,7 @@ describe('ElasticDatasource', function() {
|
|||||||
var fields = _.map(fieldObjects, 'text');
|
var fields = _.map(fieldObjects, 'text');
|
||||||
expect(fields).to.eql([
|
expect(fields).to.eql([
|
||||||
'@timestamp',
|
'@timestamp',
|
||||||
|
'beat.name.raw',
|
||||||
'beat.name',
|
'beat.name',
|
||||||
'beat.hostname',
|
'beat.hostname',
|
||||||
'system.cpu.system',
|
'system.cpu.system',
|
||||||
|
Loading…
Reference in New Issue
Block a user