hello, I need to make an aggregation and sort the results by an integer field.
I know how to do with type string, but not with integer.
"size": 0, "aggs" : {
"municipios" : {
"terms" : {
"field" : "doenca", "size":1 },
"aggs": {
"ages":
{ "terms": {
"field": "age","min_doc_count": 0,
"order" : { ???? },
"size" : 0 }
}} } }
Note: There is how to make an aggregation with range for ages?
for example from 10 to 20, 20 to 30?
Thank you so much