Field type for unix timestamp


we use ES 1.4.4
We have three fields who stores a date [format is the unix timestamp; in example 1461668482]
So far we save the field as a string - date detection is enabled.
A "from-to date aggregation // gt&lt date range query" works anyway - even if the fields are defined as strings.

Now we want to use an integer or date field type.
When date field type: with format "epoch_second"

A formatter for the number of seconds since the epoch. Note, that this timestamp allows a max length of 10 chars, so only dates between 1653 and 2286 are supported. You should use a different date formatter in that case.

But this date format is not defined in ES 1.4.4

When we use an integer i dont think that the date aggregations // date range querys still work.

Which field type did you use / would use for store and querys on unix timestamps in ES 1.4.4 ?

We currently use 1.3.4 and just use the default date type without specifying the format and it seems to handle milliseconds-since-epoch timestamps correctly. 2.3.1 however has issues with timestamps in that format that are > 13 digits.

1 Like

Thx for your answer.
I will check the date range querys with the default data type - when i am put a 10 digit timestamp into a field with the mapping "type": "date" and no format-definition ES define this field as
"type": "date",
"format": "dateOptionalTime"
now i must check the querys...