removed condition on the IP field type when retrieving doc values

This commit is contained in:
Stéphane Campinas 2016-12-17 21:30:47 +00:00
parent eb70e84a56
commit d19ba5698c
No known key found for this signature in database
GPG key ID: 8272664236A42C2F
2 changed files with 1 additions and 9 deletions

View file

@ -76,12 +76,6 @@ describe('Top hit metric', function () {
expect(aggDsl.top_hits.docvalue_fields).to.eql([ 'bytes' ]);
});
it('should only request for the source if the field is an IP', function () {
init({ field: 'ip' });
expect(aggDsl.top_hits._source).to.be('ip');
expect(aggDsl.top_hits.docvalue_fields).to.be(undefined);
});
it('should only request for the source if the field does not have the doc_values property', function () {
init({ field: 'ssl' });
expect(aggDsl.top_hits._source).to.be('ssl');

View file

@ -47,9 +47,7 @@ export default function AggTypeMetricTopProvider(Private) {
}
};
} else {
// do not try to get the doc_values for IP fields, since it is
// an internal representataion of the IP and so of no use for display.
if (field.type !== 'ip' && field.doc_values) {
if (field.doc_values) {
output.params.docvalue_fields = [ field.name ];
}
output.params._source = field.name === '_source' ? true : field.name;