check if there is any result from buckets

This commit is contained in:
Stéphane Campinas 2016-10-18 10:13:19 +01:00
parent 20cbb12e67
commit b99d6c76dd
No known key found for this signature in database
GPG key ID: 8272664236A42C2F

View file

@ -59,6 +59,9 @@ export default function AggTypeMetricTopProvider(Private) {
}
],
getValue(agg, bucket) {
if (!bucket[agg.id].hits.hits.length) {
return;
}
return bucket[agg.id].hits.hits[0].fields[agg.params.field.name][0];
}
});