Multi terms aggregation

Hello everyone, I need help with an elastic query.

My current query is:

{
  "size" : 1,
  "aggs": {
    "NAME": {
      "multi_terms": {
        "terms": [{
          "field": "fieldName1.keyword"
        }, {
          "field": "fieldName2Name.keyword"
        }, {
          "field": "fieldName3.keyword"
        }]
      }
    }
  }
}

I would like to increase "size" which is 10 by default, how should I do? Where should I place it in my query?
and I would like to display the most recent element (I have an eventDate for each of my documents) and display it from my bucket.
My goal is to use this query in a Vega Table type visualization

Thank you in advance for your answers

Hi!!

Thank you for your answer, I have already read this passage but it does not help me.. I still do not know where to put "size"..

 "multi_terms": {
        **"size":12,**
        "terms": [
           .....
        ]
      }
1 Like

thank you for your answer, is it possible to add a "value_count" to this? I would like to add it to count the distinct values in fieldName3

Hi, maybe you need cardinality aggregation to count values.

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