I have a nested date field like this:
{
"nestedField": {
"type": "nested",
"properties": {
"sellableDate": {
"properties": {
"US": {
"type": "date",
"format": "MM/dd/yyy"
}
}
}
}
}
}
when I try to sort using:
{
"sort": {
"nestedField.sellableDate.US": {
"order": "desc"
}
}
}
it doesn't work. The five results are sorted like this:
"sellableDate": { "US": "06/28/2017"}
"sellableDate": { "US": "06/28/2017"}
"sellableDate": { "US": "01/01/2001"}
"sellableDate": { "US": "06/28/2017"}
"sellableDate": { "US": "06/28/2017"}
The third results is odd. It's like it didn't applied any sorting at all. Even if I change the order of sorting, it does nothing.
EDIT: If I move this property at top level (not inside nested) it works. Any idea why this happens?