Hi
I am trying to run terms aggregation on full text field with type as 'text' and fielddata enabled.
I am getting doc_count 1 per document match instead of frequency of term.
Mapping -
{"mappings":{"data":{"properties":{"content":{"type":"text","fielddata":true} } }}}
Index data -
/test/data/1
{"content":"concrete concrete"}
Query -
{
"query": {
"match": {
"_id": "1"
}
},
"aggs": {
"content": {
"terms": {
"field": "content"
}
}
}
}
Response -
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "test",
"_type": "data",
"_id": "1",
"_score": 1,
"_source": {
"content": "concrete concrete"
}
}
]
},
"aggregations": {
"content": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "concrete",
"doc_count": 1
}
]
}
}
}
doc_count should be 2 ?
Thanks,
Ankita