What are you trying to accomplish exactly in that script? There might be a better/easier way to do it.
But from what I can see, this line: if (count =~ /${listarray[i]}/) should be changed to if (count =~ /listarray[i]/)
and this line: returnValue += listarray; should probably be returnValue += listarray[i];
Thanks for the response.
Read the discussion. Since the index-pattern field value is a string and not an array, I cant update it with "source": "ctx._source.tags.add(params.tag)" by adding to the array. So what is the best way to update the field?
Is there a way to simply replace it with something like source": "ctx._source.fields = params.field"
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.