【问题标题】:'Unknown BaseAggregationBuilder [composite] error' when running elasticsearch composite aggregation运行弹性搜索复合聚合时出现“未知 BaseAggregationBuilder [复合] 错误”
【发布时间】:2020-08-13 05:24:07
【问题描述】:

我正在尝试根据此处的文档创建一个复合聚合: https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-aggregations-bucket-composite-aggregation.html

我基本上遵循这个例子:

curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
    "aggs" : {
        "my_buckets": {
            "composite" : {
                "sources" : [
                    { "product": { "terms" : { "field": "product" } } }
                ]
            }
        }
     }
}
'

但每次我尝试运行代码时,无论我尝试聚合哪个字段,都会收到以下错误:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "unknown_named_object_exception",
        "reason" : "Unknown BaseAggregationBuilder [composite]",
        "line" : 5,
        "col" : 27
      }
    ],
    "type" : "unknown_named_object_exception",
    "reason" : "Unknown BaseAggregationBuilder [composite]",
    "line" : 5,
    "col" : 27
  },
  "status" : 400
}

我做了一些挖掘,并没有看到错误“Unknown BaseAggregationBuilder [composite]”出现在其他任何地方,所以我想我会在这里发布这个问题,看看是否有人遇到过类似的问题。基数和正则项聚合工作正常。另外澄清一下,我在 v6.8 上运行

【问题讨论】:

  • 你能分享你的映射和示例文档吗

标签: elasticsearch elasticsearch-aggregation


【解决方案1】:

复合 aggs 已在 6.1.0 中发布。该错误听起来像您不可能使用 >=6.1 而是一些较旧的版本。

当您运行curl -X GET "localhost:9200" 时,您的version.number 是什么?

【讨论】:

    猜你喜欢
    • 2017-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-18
    • 2018-08-06
    • 2019-11-08
    • 2021-02-19
    相关资源
    最近更新 更多