I'm using UpdateByQuery from java api. Then i'm setting timestamp value to date field. But this error returned.
ScriptException[compile error]; nested: IllegalArgumentException[invalid sequence of tokens near ['16'].]; nested: NotSerializableExceptionWrapper[no_viable_alt_exception: null];
Here is my source.
"ctx._source.action_date = 2018-11-20 16:00:00.000;"
Here is part of error
Caused By: java.lang.IllegalArgumentException: invalid sequence of tokens near ['16'].
at org.elasticsearch.painless.PainlessScript$Script.compile(ctx._source.action_date=2018-11-20 16:00:00.000;
Should i set timestamp format. And how ? Any recommendation ?
Thanks in advance.
The date format isn't your issue in this case - the problem causing that exception is that your Painless has a syntax error. You'll need to wrap the the date in quotes:
Now, I can't say for sure that you won't also run into an issue with the date formatting without seeing your mapping. However, if this date string is the same as the format originally used in the document, you should be fine.
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.