ES Sorting on datetimestamp

Hi Elasticsearch community,

I have a doubt/ask, I need to get the latest record from the hits based on a date timestamp column. The format of date time column i.e. 'time': 'Mon Oct 26 20:04:11 2020'

Kindly help me out here,
I am using this but didn't work.
"size": 1,
"sort": { "time": "desc"},

Thanks !!

Welcome!

As long as your mapping is correct (and your field is a date datatype), this looks correct.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.