Mapping Time field without date

Hi

In my logs, I have time field that only capture the time of the day. What should be mapping of this field should be in Elastic.

For e.g.

07:10:20 AM

08:20:50 PM

If I define the mapping as date with "format" : "hh:mm:ss a" then I get a timestamp from 1970 and if define the mapping as string then sorting and range queries become an issue.

Thanks
Vinay

1 Like

You are better of fixing it before it goes into ES.

1 Like

Is there a way to just create a mapping for Time without the date?

Thanks

If you really want to - https://www.elastic.co/guide/en/elasticsearch/reference/2.2/mapping-date-format.html