Thanks for your interest Wylie,
Here is the request:
{
"aggs": {
"2": {
"terms": {
"field": "exchange",
"order": {
"_count": "desc"
},
"size": 5
},
"aggs": {
"3": {
"sum_bucket": {
"buckets_path": "3-bucket>_count"
}
},
"3-bucket": {
"filters": {
"filters": {
"event_type:\"TRADE\"": {
"bool": {
"must": [],
"filter": [
{
"bool": {
"should": [
{
"match_phrase": {
"event_type": "TRADE"
}
}
],
"minimum_should_match": 1
}
}
],
"should": [],
"must_not": []
}
}
}
}
}
}
}
},
"size": 0,
"fields": [
{
"field": "@timestamp",
"format": "date_time"
}
],
"script_fields": {},
"stored_fields": [
"*"
],
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"match_all": {}
},
{
"range": {
"@timestamp": {
"gte": "2021-02-23T17:34:45.678Z",
"lte": "2021-02-23T17:49:45.678Z",
"format": "strict_date_optional_time"
}
}
}
],
"should": [],
"must_not": []
}
}
}
and the response
{
"took": 606,
"timed_out": false,
"_shards": {
"total": 298,
"successful": 298,
"skipped": 286,
"failed": 0
},
"hits": {
"total": 13830873,
"max_score": null,
"hits": []
},
"aggregations": {
"2": {
"doc_count_error_upper_bound": 97798,
"sum_other_doc_count": 5683926,
"buckets": [
{
"3": {
"value": 0
},
"key": "binancefut",
"doc_count": 1997919,
"3-bucket": {
"buckets": {
"event_type:\"TRADE\"": {
"doc_count": 0
}
}
}
},
{
"3": {
"value": 0
},
"key": "binance",
"doc_count": 1987809,
"3-bucket": {
"buckets": {
"event_type:\"TRADE\"": {
"doc_count": 0
}
}
}
},
{
"3": {
"value": 0
},
"key": "ftx",
"doc_count": 1634364,
"3-bucket": {
"buckets": {
"event_type:\"TRADE\"": {
"doc_count": 0
}
}
}
},
{
"3": {
"value": 0
},
"key": "kraken",
"doc_count": 1308034,
"3-bucket": {
"buckets": {
"event_type:\"TRADE\"": {
"doc_count": 0
}
}
}
},
{
"3": {
"value": 0
},
"key": "gdax",
"doc_count": 1218813,
"3-bucket": {
"buckets": {
"event_type:\"TRADE\"": {
"doc_count": 0
}
}
}
}
]
}
}
}
Ah.. now i see that doc_count error... could that be my issue? there are only a relatively small amount of docs there. (less than 100 out of a total of 13 million..)