I'm trying to add a field to documents in an index.
I want to bake in the @timestamp field.
If I use something like the following in a curl -XPOST
-d '{
"script" : { "ctx.source.extra_field = ctx._source.timestamp;", "lang" : "painless" },
"query" : " { "match_all": {} }
}'
I get an extra field with null in.
Of course, saying ctx._source.@timestamp is a syntax error.
(I'm actually going to try to concatenate a few fields so we can avoid a like/contains lookup, however tried a simple example first, which doesn't work.)
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.