I am trying to aggregate on a field that has type text.
Mapping setting:
"Group":{"type":"text"}
And query:
{
"query": {
"term": {
"request_id": 22
}
},
"size": 0,
"aggs": {
"sets": {
"terms": {"field": "Group.keyword"}
}
}
}
This gives empty results:
"hits": {
"total": 7463,
"max_score": 0,
"hits": []
},
"aggregations": {
"sets": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}
}
Without .keyword gives illegal_argument_exception.. reason: ... alternatively use a keyword field instead..
Also, values in Group field are Grp1 and Grp2 only.
How can I aggregate sets based on these two values?