Retrieve distinct values from multiple fields in ElasticSearch


(Stash Faj) #1

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"}
}
}
}
}
}
}
}


(system) #2

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