Accessing _timestamp value in ES 2.0


(lisak) #1

Hey,

the migration plugin gives me this warning :

The _timestamp field will only accept the enabled, format, and default parameters in future indices. Importantly, it will not be possible to extract the _timestamp value from a path., in type: record.

I'm using this mapping :
"_timestamp": { "enabled": true, "store": true, "doc_values": true }

To be able to access the _timestamp value. Does it mean that in 2.0 the "store" feature won't be possible?


(Shane Connelly) #2

This refers to a few things. They both stem from this, but to give a little color, I'll go in opposite order of what the warning is given :grin:

First, the "it will not be possible to extract the _timestamp value from a path" refers to the deprecation/discussion here. It's a fairly short and easy read, so you may want to have a look over that to see if there's anything that affects you.

Second, the "the _timestamp field will only accept the enabled, format, and default parameters in future indices" relates to locking down bizarre (and sometimes ambiguous) mappings. On the contrary to it not being stored, the option to not store it was removed, so any explicit store setting is warned against. That part comes from this. There are a number of weird combinations which were removed.

All of this said, you probably shouldn't be using the _timestamp if you can avoid it. Instead, you can use a regular date field, which allows you to use multiple dates/times in the same document, etc.

Does this help?


(lisak) #3

Thank you Shane,

I actually don't use it anymore, now I'm only scanning indices with _timestamp based range.

So I'll change _timestamp mapping of future indices to :
"_timestamp": { "enabled": true, "doc_values": true }

Anyway from what I understand I don't have to reindex anything...


(system) #4