Using a missing aggregation for a Term, as opposed to a field

Hi all,

I'm hoping this is the right place to ask this. I'm trying to get an aggregation of the items that don't contain a specific field. They're items with a nested field, as follow:

                 "customFields": [
                     {
                         "key": "firstType",
                         "keywordValue": "1"
                     },
                     {
                         "key": "secondType",
                         "keywordValue": "A"
                     }
                 ]

I've been trying to use a missing aggregation, if I was trying to find all the items that don't contain a key with the value firstType, but haven't had much luck. The query I've made is:

 "aggregations": {
       "custom.firstType": {
               "missing": {
                 "field": "firstType"
               },
               "aggregations": {
                 "values": {
                   "reverse_nested": {}
                 }
               }
             }
           }

Unfortunately, this hasn't been much luck for me. What am I over looking?

Thanks!

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