I am looking for one example on how to extract distinct values of a nested type property in elastic search. Could anyone provide an example?
I have a below query where I am trying to retrieve distinct values of "batchId" from nested type "admin" as follows:
{
"aggs" : {
"groupBatches" : {
"nested": {
"path": "admin"
},
"aggs" : {
"batches" : {
"terms" : {"field" : "admin.ids.batchId"}
}
}
}
}
}
If what I am trying is wrong, Please provide some example for better understanding.