I need to be able to provide timestamps that will be preserved by ES. I'm
using the _timestamp field (although perhaps I shouldn't, because) it seems
that the values I provide are being ignored, and the current date-time is
being inserted instead. My mapping configuration looks like this:
dynamic: strict
_source:
enabled: false
_all:
enabled: false
_timestamp:
type: date
enabled: true
index: not_analyzed
store: true
properties:
...
I've tried providing the times as longs, as longs converted to strings, as
ISO-formatted date-times (YYYYMMDDThhmmss.SSS), but nothing seems to have
any effect -- I might as well provide 0.
I'm inserting documents using the Java client API by creating a Map, with
key="_timestamp" and values as described above.
Has anybody run across this before? It seems like a very standard use case
if you want to keep a consistent timestamp across a cluster, or in any way
copy documents without updating their timestamps.
quick follow-up -- of course using my own long-valued field seems to work
just fine, but I would still like to understand what's going on here. It
might be nice to have the internally-generated behavior as a fallback?
On Sunday, April 6, 2014 1:18:55 PM UTC-4, Michael Sokolov wrote:
I need to be able to provide timestamps that will be preserved by ES. I'm
using the _timestamp field (although perhaps I shouldn't, because) it seems
that the values I provide are being ignored, and the current date-time is
being inserted instead. My mapping configuration looks like this:
dynamic: strict
_source:
enabled: false
_all:
enabled: false
_timestamp:
type: date
enabled: true
index: not_analyzed
store: true
properties:
...
I've tried providing the times as longs, as longs converted to strings, as
ISO-formatted date-times (YYYYMMDDThhmmss.SSS), but nothing seems to have
any effect -- I might as well provide 0.
I'm inserting documents using the Java client API by creating a Map, with
key="_timestamp" and values as described above.
Has anybody run across this before? It seems like a very standard use
case if you want to keep a consistent timestamp across a cluster, or in any
way copy documents without updating their timestamps.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.