Hi everyone,

I am trying to figure something out :

Here's an example of a document that contains object properties, and then 
trying to do simple terms aggregations.
https://gist.github.com/BAmine/80e1be219d2ac272561a

The response I get :
{
   "took": 2,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 1,
      "max_score": 0,
      "hits": []
   },
   "aggregations": {
      "test": {
         "buckets": [
            {
               "key": "canine",
               "doc_count": 1,
               "test2": {
                  "buckets": [
                     {
                        "key": "cat",
                        "doc_count": 1
                     },
                     {
                        "key": "dog",
                        "doc_count": 1
                     },
                     {
                        "key": "tiger",
                        "doc_count": 1
                     },
                     {
                        "key": "wolf",
                        "doc_count": 1
                     }
                  ]
               }
            },
            {
               "key": "feline",
               "doc_count": 1,
               "test2": {
                  "buckets": [
                     {
                        "key": "cat",
                        "doc_count": 1
                     },
                     {
                        "key": "dog",
                        "doc_count": 1
                     },
                     {
                        "key": "tiger",
                        "doc_count": 1
                     },
                     {
                        "key": "wolf",
                        "doc_count": 1
                     }
                  ]
               }
            }
         ]
      }
   }
}

The question is : How can I avoid getting, in my sub-aggregations, buckets 
whose keys do not belong to the parent aggregation's keys ( example : cat 
and tiger are not in the property whose label is feline ) ?
Is there a way to do this without using nested properties ?

Thank you !

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/2fb7d54b-9a52-4583-ae62-f95cbf1c5e35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to