Hi all and sorry for my poor english.
I'd like to sort by creation (string) field this query
GET /profiles/_search
{
"aggs": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"creation": {
"from": "2017-03-11 T 00:00:00.000+0000",
"to": "2021-03-12 T 00:00:00.000+0000"}
}
} ,
{
"terms":
{
"type" : ["default"]
}
}
]
}
},
"aggs": {
"type_profile": {
"terms": {
"field": "type"
},
"aggs":{
"date_creation": {
"terms": {
"field": "creation"
}
}
}
}
}
}
} ,
"size": 0
}
I tried using bucket_sort but with no success
Thanks in advance