Hi, this is about having the buckets of a terms aggregation sorted by a metric sub-aggtregation instead of the doc_count of the bucket. Unfortunately, Timelion does not support this at the moment.
However, the Time Series Visual Builder visualization can do this. Note how I'm able to order by "Sum of metric":
BTW TSVB just uses aggregation features of Elasticsearch to do this. A raw Elasticsearch query for data ordered like this looks like:
POST /metrics/_search
{
"aggs": {
"cats": {
"terms": {
"field": "cat",
"size": 10,
"order": {
"metric_sum": "desc"
}
},
"aggs": {
"metric_sum": {
"sum": {
"field": "metric"
}
}
}
}
}
}
