脚本度量标准聚合顺序

时间:2015-04-14 08:23:14

标签: elasticsearch

在elasticsearch 1.5.0中,我尝试使用scripted_metric结果对聚合存储桶进行排序/排序,但收到以下错误:

AggregationExecutionException [无效术语聚合顺序路径[custom_script]。术语桶只能在子聚合器路径上排序,该路径由路径中的零个或多个单桶聚合构成,最后一个桶或路径末端的度量聚合

是解决这个问题的方法吗?

我的查询是这样的:

"aggs": {
    "mygroup": {
      "terms": {
        "field": "customername",
        "order": {
          "custom_script": "asc"
        }
      },
      "aggs": {
        "custom_script": {
          "scripted_metric": {
            ...
          }
        }
      }
    }
  }

1 个答案:

答案 0 :(得分:2)

不,这是当前的限制。在https://github.com/elastic/elasticsearch/issues/8486

中进行跟踪
相关问题