nested 聚合怎么排序 报错non single-bucket aggregation
Elasticsearch | 作者 mafa1993 | 发布于2017年10月30日 | 阅读数:6361
{
"size": 0,
"aggs": {
"every": {
"terms": {
"field": "origin.e.keyword",
"order": {
"content>fil._count": "desc"
}
},
"aggs": {
"content": {
"nested": {
"path": "middle.n"
},
"aggs": {
"fil": {
"filter": {
"term": {
"middle.n.field.keyword": "eml_to"
}
},
"a": {
"top_hits": {
"size": 1
}
}
}
}
}
}
}
}
}
}
报错:
"reason": "Invalid terms aggregation order path [content>fil._count]. Terms buckets can only be sorted on a sub-aggregator path that is built out of zero or more single-bucket aggregations within the path and a final single-bucket or a metrics aggregation at the path end. Sub-path [content] points to non single-bucket aggregation"
"size": 0,
"aggs": {
"every": {
"terms": {
"field": "origin.e.keyword",
"order": {
"content>fil._count": "desc"
}
},
"aggs": {
"content": {
"nested": {
"path": "middle.n"
},
"aggs": {
"fil": {
"filter": {
"term": {
"middle.n.field.keyword": "eml_to"
}
},
"a": {
"top_hits": {
"size": 1
}
}
}
}
}
}
}
}
}
}
报错:
"reason": "Invalid terms aggregation order path [content>fil._count]. Terms buckets can only be sorted on a sub-aggregator path that is built out of zero or more single-bucket aggregations within the path and a final single-bucket or a metrics aggregation at the path end. Sub-path [content] points to non single-bucket aggregation"
3 个回复
exceptions - 。。。
赞同来自: mafa1993
这个是深度度量聚合的,有点老:https://www.elastic.co/guide/c ... .html
这个是nested的:
https://www.elastic.co/guide/e ... .html
这个要邀请大神来回答了
medcl - 今晚打老虎。
赞同来自: mafa1993
LiuYang1
赞同来自: