hi i want to know the date of my min and max value
i have this aggs
"aggs": {
"infodate": {
"date_histogram": {
"field": "datecreation",
"interval": "month"
},
"aggs": {
"moyenneposition": {
"avg": {
"field": "position"
}
},
"minpos":{
"min": {
"field": "position"
}
},
"maxpos" :{
"max": {
"field": "position"
}
}
}
}
}
but on the min and max for each mont i want to know the date for the min value and the date for the max value ? it's possible ?
in result
{
"key_as_string": "2017-05-01T00:00:00.000Z",
"key": 1493596800000,
"doc_count": 241,
"moyenneposition": {
"value": 89.00165971829189
},
"minpos": {
"value": 1
},
"maxpos": {
"value": 450
}
}
and i want for example
"maxpos": {
"value": 450,
"datecreation":"yyyy-mm-dd"
}
thanks