I have an index with fields like that
"_source": {
"ProductID": "7ab9772e-1e92-48c9-bfbb-a6d200b42fbe",
"productName": "ABC",
"theme_id":"dsadsad",
"theme_name":"sdsd"
}
I want to get the unique key value pair like productid and corresponding product name , how can i achieve this
I tried something like this
{
"aggs":{"Theme":{"terms":{"script":{"source":"[doc['theme_id'].value , doc['theme_name'].value]"},"size":10000}}},"query":{"bool":{"must":[{"terms":{"globalId":["af897ece-6b99-4c23-aa73-a6d200b354f3"]}}]}},"size":0
but with this approach i m getting unique values in multiple bucket , different bucket for themeid and theme name .please help me to figure out this