不要急,总有办法的

elasticsearch聚合结果排序

Elasticsearch | 作者 redhat | 发布于2017年04月26日 | 阅读数:6569

"mainBody": {

"doc_count_error_upper_bound": 170,
"sum_other_doc_count": 2707283,
"buckets": [
{
"key": "",
"doc_count": 8678677,
"hit": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 0,
"doc_count": 8200412
}
,
{
"key": 1,
"doc_count": 478265
}
]
}
}
}
需求:如上所示,我想根据hit下,key=1来倒序排序,不知道如何实现,请大神们不吝赐教,抱拳了。
已邀请:

yunfeng

赞同来自:

term聚合有order字段,应该可以吧

要回复问题请先登录注册