I'm looking to group the terms returned from the significant terms aggregation.
Something that would take a significant terms response from this:
[
{
"key" : "ok",
"doc_count" : 200,
"score" : 8.583258052060206E-4,
"bg_count" : 213
},
{
"key" : "okay",
"doc_count" : 117,
"score" : 4.814546694690713E-4,
"bg_count" : 126
},
{
"key" : "something else",
"doc_count" : 100,
"score" : 2.3240213379936128E-4,
"bg_count" : 78
}
]
and change it too something like this
[
{
"grouped_keys" : ["ok","okay"],
"doc_count" : 317,
"score" : 8.583258052060206E-4,
"bg_count" : 339
},
{
"grouped_keys" : ["something else"],
"doc_count" : 100,
"score" : 2.3240213379936128E-4,
"bg_count" : 78
}
]
I haven't really tried too much, as I have no idea where to start. I did some reading into link but I'm not too sure how relevant it is https://discuss.elastic.co/t/group-documents-by-similarity-using-elser/342913/3