Eugene Blinn
Eugene Blinn

Reputation: 323

'Unknown BaseAggregationBuilder [composite] error' when running elasticsearch composite aggregation

I'm trying to create a composite aggregation per the documentation here: https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-aggregations-bucket-composite-aggregation.html

I'm basically following this example:

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

but every time I try to run the code I get the below error regardless of which field I try to aggregate on:

{
  "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
}

I did some digging around and haven't seen the error 'Unknown BaseAggregationBuilder [composite]' come up anywhere else so I thought I'd post this question here to see if anyone has run into a similar issue. Cardinality and regular terms aggregation work fine. Also to clarify, I'm running on v6.8

Upvotes: 2

Views: 646

Answers (1)

Joe - Check out my books
Joe - Check out my books

Reputation: 16925

Composite aggs were released in 6.1.0. The error sounds like you cannot possibly be using >=6.1 but some older ver.

What's your version.number when you run curl -X GET "localhost:9200"?

Upvotes: 2

Related Questions