Retrieve distinct values from multiple fields in ElasticSearch

Hello,

How can I retrieve distinct values from multiple fields in elasticsearch ?

I have used the below method, but it seems too nested. Can someone provide a more efficient way of doing it ?

{
"size":"0",
"aggs" : {
"uniq_lest" : {
"terms" : { "field" : "Area.keyword" },
"aggs" : {
"uniq_test" : {
"terms" : { "field" : "Locati.keyword"},
"aggs" : {
"uniq_mest" : {
"terms" : { "field" : "Age.keyword"}
}
}
}
}
}
}
}

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