How to aggregate param filtered by nested path?

Hi, I want to build aggregation on parameter but filtered by nested path. Something like this:

 "aggs": {
      "events.name12": {
     "filter": {},
     "aggs": {
        "events": {
           "nested": {
              "path": "events"
           },
           "aggs": {
              "filtered.events": {
                 "filter": {
                    "terms": {
                       "events.id": [
                          448,
                          435,
                          338,
                          364
                       ]
                    }
                 },
                 "aggs": {
                    "filtered": {
                       "filter": {},
                       "aggs": {
                          "profile.email": {
                             "terms": {
                                "field": "email",
                                "size": 5
                             }
                          },
                          "profile.email_name": {
                             "cardinality": {
                                "field": "email"
                             }
                          }
                       }
                    }
                 }
              }
           }
        }
     }
  }
  },

is this possible ?

Can you provide a minimal example? I don't understand your question.

I'm building aggregation on nested path, but at the bottom level is field "email" which is not at defined path for aggregator. I want to build aggregate of "email" where events.id are as provided (nested mapping)

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