From the documentation, I was expecting this value to be anything greater than or equal to 0. Please correct me if am wrong and kindly explain (or point to a documentation) when it would be negative.
Attached below is my query and part of the response
Query :
{
"from": 0,
"size": 0,
"sort": {
"date.keyword": {
"order": "asc"
}
},
"aggs": {
"days": {
"terms": {
"field": "dstMongoId.keyword",
"order": {
"total_repetitions": "desc"
},
"exclude": ["db9566d7-19e3-0877-7edc-9dd1b8203d91"],
"size": 20,
"shard_size":40
},
"aggs": {
"total_repetitions": {
"sum": {
"field": "repetitions"
}
},
"dsts": {
"terms": {
"field": "_index",
"order": {
"total_repetitions": "desc"
},
"size":15,
"shard_size":30
},
"aggs": {
"total_repetitions": {
"sum": {
"field": "repetitions"
}
},
"postTypes": {
"terms": {
"field": "postType.keyword",
"size":2,
"shard_size":4
},
"aggs": {
"platforms": {
"terms": {
"field": "platform.keyword",
"size":4,
"shard_size":8
},
"aggs": {
"total_repetitions": {
"sum": {
"field": "repetitions"
}
}
}
}
}
}
}
}
}
}
},
"query": {
"bool": {
"must": [{
"term": {
"dstType.keyword": "BRAND"
}
},
{
"term": {
"srcType.keyword": "BRAND"
}
},
{
"term": {
"srcMongoId.keyword": "db9566d7-19e3-0877-7edc-9dd1b8203d91"
}
},
{
"range": {
"date.keyword": {
"gte": "20170328",
"lt": "20180329"
}
}
}
]
}
}
}
Response :
{
"took": 23,
"timed_out": false,
"_shards": {
"total": 80,
"successful": 80,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 5248,
"max_score": 0,
"hits": []
},
"aggregations": {
"days": {
"doc_count_error_upper_bound": -1,
"sum_other_doc_count": 2757,