4
votes

Before version 2.0, you would create a field _timestamp in your type: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html

Unfortunately, this has been deprecated. The new replacement for this is the 'date' field but this has to be filled explicitly.

Is there a way to auto generate a create date?

1
If you use Logstash to index your documents, you could delegate this task to Logstash.Val
Such a pitty, I though that someone might know some trick by using a scripted filed or something alike.herrphon

1 Answers

5
votes

According to the breaking changes documentation _timestamp is deprecated and there is no dedicated replacement for it:

Instead of the _timestamp field, use a normal date field and set the value explicitly.

That means that it is entirely up to the client to set the documents creation time.