Skip to content

Commit

Permalink
support nested fields
Browse files Browse the repository at this point in the history
  • Loading branch information
scampi committed Oct 11, 2016
1 parent 22bab62 commit 8aef2b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/public/agg_types/metrics/latest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { get } from 'lodash';
import AggTypesMetricsMetricAggTypeProvider from 'ui/agg_types/metrics/metric_agg_type';
import latestEditor from 'ui/agg_types/controls/latest.html';

Expand Down Expand Up @@ -36,7 +37,7 @@ export default function AggTypeMetricAvgProvider(Private) {
}
],
getValue(agg, bucket) {
return bucket[agg.id].hits.hits[0]._source[agg.params.field.name];
return get(bucket[agg.id].hits.hits[0]._source, agg.params.field.name);
}
});
};

0 comments on commit 8aef2b8

Please sign in to comment.