hello,
I use elastic cloud 7.x and I try to limit aggregate count to retreive only TOP 10 / per day (not all results)
I use this query, but it is so slow.... :
{
"aggs": {
"2": {
"date_histogram": {
"field": "emailInfo.mailProcessingStartTime",
"interval": "1h",
"time_zone": "Europe/Paris",
"min_doc_count": 1
},
"aggs": {
"6": {
"terms": {
"field": "emailInfo.headerFrom.keyword",
"size": 5,
"order": {
"_count": "desc"
}
}
}
}
}
},
"size": 0,
"_source": {
"excludes":
},
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
{
"field": "emailInfo.mailProcessingStartTime",
"format": "date_time"
}
],
"query": {
"bool": {
"must": ,
"filter": [
{
"match_all": {}
},
{
"match_all": {}
}
],
"should": ,
"must_not":
}
}
}
Thanks for your help !