Multi_terms aggregation gives me an error

Hello !
I'm trying to use ElasticSearch v. 7.11.1 on Windows 10. I don't know how to make multi_terms aggregation work. This query:

{
  "aggs": {
    "test_agg": {
      "multi_terms": {
        "terms": [{
          "field": "JobTitle.keyword" 
        }, {
          "field": "AboutMe.keyword"
        }]
      }
    }
  }
}

gives me this:

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "Unknown aggregation type [multi_terms] did you mean [rare_terms]?",
        "line": 4,
        "col": 22
      }
    ],
    "type": "parsing_exception",
    "reason": "Unknown aggregation type [multi_terms] did you mean [rare_terms]?",
    "line": 4,
    "col": 22,
    "caused_by": {
      "type": "named_object_not_found_exception",
      "reason": "[4:22] unknown field [multi_terms]"
    }
  },
  "status": 400
}

but this query:

{
  "aggs": {
    "test_agg": {
      "terms": 
			{
				"field": "JobTitle.keyword",
				"size": "10"
            }
    }
  }
}

works.

1 Like

Exactly same behavior for me, I don't know what I'm doing wrong

@pmsearcher I think I've found an issue. What version of Elasticsearch do you use?
I found this PR and, as I see, multi_terms aggregation was added in version 7.12
That's why I can't use this feature (my cluster's version is 7.9)

Hi !
Yes I asked this question also on StackOverflow and got a reply. My version is 7.11. So it's a very fresh feature

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.