Is it possible to use scripted metric
aggregation to stringify the result of terms
aggregation?
I have a terms
aggregation that returns 20 buckets like:
{
"key": "a",
"doc_count": 1155
},
{
"key": "b",
"doc_count": 291
},
{
"key": "c",
"doc_count": 232
},
{
"key": "d",
"doc_count": 202
},
{
I would like another aggregation that will return concatenated string, like "a(1155),b(291),c(232),d(202)"
Is it possible to do via script?