I am managing hundreds of scripts that all use an inline script to go through the nested buckets inside the ctx.payload structure. We've recently run into the circuit break error of: "reason": "[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting".
We can increase that setting, but going forward it would be better if I could create a stored script and have all the watchers call it. The problem is I haven't been able to send the ctx.payload structure through as a parameter.
Elastock, to do this, my watcher (posted above) would have to first post the payload to the docs array, then call the stored script which would access it?
I was able to solve my problem....the ctx is not passed through as a parameter; it is recognized by session. I have many watchers all calling the same stored script which references ctx.payload. When the script is called it references the ctx that corresponds to the session of the watcher that calls it at the time. I didn't think this would work but that is exactly how it works.
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.