Sorting histogram aggregation


(Frederes) #1

I have a request like this :

{
"aggs": {
"days" : {
"date_histogram" : {
"field" : "day",
"interval" : "day",
"format": "yyyy-MM-dd",
"min_doc_count" : 1
},
"aggs": {
"total_impressions" : { "sum" : { "field" : "impressions" } }
}
}
}
}

How can i specify the sorting order for 'days' field ? (they are default ordered ASC in my case)

Thanks for your help :wink:


(system) #2