I am new to elastic search, as of now i have a requirement cause of which i need to group by a text field.
Now the most common answer to this question is to enable field data on an existing text field using the PUT mapping API.
Is there a simpler way to account for this situation without updating a template or index.
sample query:
GET ****/message/_search
{
"_source": ["identifier"],
"size": 0,
"aggs": {
"group_by_coll_conv": {
"terms": {
"field": "identifier"
},
"aggs": {
"count" : {
"value_count" :
{
"field" : "something"
}
}
}
}
}
Any help would be appreciated
Thanks
The other easier way you are asking for:
You can just append .keyword to the field name you want to search text from. For eg: field name is identifier, so just use it as identifier.keyword
This will help you for sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With