我在elastic search中尝试复合聚合,但发现奇怪的是,我通常可以在术语聚合中执行的操作对于复合聚合中的术语不受支持!
请参见下面的查询:
GET _search
{
"size": 0,
"query": {
"match_all": {}
},"aggs": {
"compo": {
"composite": {
"sources": [
{
"terms_inside": {
"terms": {
"field": "result_type",
"order": {
"_count": "asc" // not supported here!
}
}
}
}
]
}
},
"just_terms" :{
"terms": {
"field": "result_type",
"order": {
"_count": "asc" // supported here
}
}
}
}
}
是这样的,还是有一种方法可以通过嵌套的术语聚合在doc count上获取排序的bucket。我想对术语聚合使用分页和排序。