is there anyway that we can buckets based on id and display based on Name?
{
"aggs" : {
"topAdvisors" : {
"terms" : {
"field" : "advRepNum"
}
}
}
}
Output :
"buckets":
[
{
"key": "9813",
"doc_count": 433
},
{
"key": "19076",
"doc_count": 275
},
{
"key": "6877",
"doc_count": 30
},
{
"key": "19347",
"doc_count": 67
}
]
Expected Output:
"buckets":
[
{
"key": "John",
"doc_count": 433
},
{
"key": "Smith",
"doc_count": 275
},
{
"key": "Tom",
"doc_count": 30
},
{
"key": "Ben",
"doc_count": 67
}
]