terms aggs should be sorted by the metric agg

This commit is contained in:
Spencer Alger 2014-09-02 14:25:32 -07:00
parent 72031972ca
commit 0da1f583e7
2 changed files with 5 additions and 6 deletions

View file

@ -10,8 +10,6 @@
- a legit way to update the index pattern
- **[src/kibana/apps/settings/sections/indices/_create.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/settings/sections/indices/_create.js)**
- we should probably display a message of some kind
- **[src/kibana/components/agg_types/buckets/terms.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/agg_types/buckets/terms.js)**
- We need more than just _count here.
- **[src/kibana/components/index_patterns/_mapper.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/index_patterns/_mapper.js)**
- Change index to be the resolved in some way, last three months, last hour, last year, whatever
- **[src/kibana/components/visualize/visualize.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/visualize/visualize.js)**

View file

@ -28,10 +28,11 @@ define(function (require) {
editor: require('text!components/agg_types/controls/order_and_size.html'),
default: 'desc',
write: function (aggConfig, output) {
// TODO: We need more than just _count here.
output.params.order = {
_count: aggConfig.params.order.val
};
var metricAgg = _.first(aggConfig.vis.aggs.bySchemaGroup.metrics);
output.params.order = {};
output.params.order[metricAgg.id] = aggConfig.params.order.val;
}
}
]