Can you share the exception/ error that you receive and the mapping of your documents? If you can also check the value is defined in all documents and is an array in all cases that would also be useful.
Hi. Tere is no exception or errors. The query returns a Valid response.
Also some documents may have null initially as the array that is why the conditional statement is included.
Hi
It seems that it executes the script only once.
i.e. The first time it works, but subsequent times it is ignored.
Is our syntax correct because it seems the condition:
if (ctx._source.repliesList == null) {ctx._source.repliesList = new ArrayList();}
If it is false, the rest of the script does not execute! Thanks
Where are you defining this painless script? If you're looking to run a multi-line script I would recommend using triple quotes as outlined in the documentation.
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.