Hi,
I have an index & type in elasticsearch which has a field mapping
,
"data_received_on": {
"type": "date",
"format": "YYYY-MM-DD"
},
I need to get the newest 10 records and i have about 5000 records that is spread out over the last 1 month.
ie. date_received_on field has values ranging from 2017-09-01 to 2017-09-30.
But my sorting does not give me the records in the right order when I order by this date. When I order by a number or string field it works well, but the moment I use a date field, it behaves unpredictably.
my sort condition is simple
"sort" : {
"data_received_on" : {
"order" : "desc"
}
}
What do I need to do differently to get the date field based sorting right?