my aggregation query like this :
{
"size": 0,
"query": {
"bool": {
"must": [
{
"term": {
"month_id": {
"value": 154,
"boost": 1
}
}
}
]
}
},
"aggregations": {
"group_by_thread_id": {
"terms": {
"field": "thread_id",
"size": 50,
"shard_size": -1,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_term": "asc"
}
]
}
}
},
"highlight": {},
"ext": {}
}
response like this as fellow:
{
"took": 498,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 7140222,
"max_score": 0,
"hits": [ ]
},
"aggregations": {
"group_by_thread_id": {
"doc_count_error_upper_bound": 10,
"sum_other_doc_count": 7140093,
"buckets": [
{
"key": 4028841712554024,
"doc_count": 7
}
,
{
"key": 4032481949343890,
"doc_count": 6
}
,
{
"key": 4027269313757139,
"doc_count": 3
}........
but when I query by term the key 4028841712554024 ,query like this :
{
"size":0,
"query": {
"bool": {
"must": [
{
"term": {
"thread_id": {
"value": "4028841712554024",
"boost": 1
}
}
}
]
}
},
"highlight": {},
"ext": {}
}
response like this :
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 55,
"successful": 55,
"failed": 0
},
"hits": {
"total": 8,
"max_score": 0,
"hits": [ ]
}
}
my question is : aggregations how can I get accurate value for the record ?
thanks and regards