POST /test/log
{
"msg": ["text","text"]
}
I have indexed the above document and tried term aggregation
GET /test/_search
{
"aggs": {
"NAME": {
"terms": {
"field": "msg.keyword"
}
}
}
}
output :
"aggregations": {
"NAME": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "text",
"doc_count": 1
}
]
}
}
My expected result could be
"aggregations": {
"NAME": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "text",
**"doc_count": 2**
}
]
}
}
I am expecting to get doc_count as 2
since it has two occurrence of "text".