Hi all,
I have a simple aggregation that gives me the number of docs for each day in the last thirty days (using date_histogram aggregation).
I need the top 5 days as amount of documents.
How can I get it?
Thanks in advance!
{
"size": 0,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
{
"range": {
"unixtsms": {
"gte": 1496527200000,
"lte": 1497045599999,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"_source": {
"excludes": []
},
"aggs": {
"2": {
"date_histogram": {
"field": "unixtsms",
"interval": "1d",
"time_zone": "Europe/Berlin",
"min_doc_count": 1
}
}
}
}