Fetch distinct values in a nested type field in elasticsearch? Can anyone provide one example?

{
"aggs" : {
"groupBatches" : {
"nested": {
"path": "admin"
},
"aggs" : {
"batches" : {
"terms" : {"field" : "admin.ids.batchId"}
}
}
}
}
}
This is i got from 1 link but my requirement is same can anybody help me.

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