I am currently trying to debug a script written in the Elasticsearch "painless" scripting language. This script is stored on the cluster and using parameters to update a document by ID. It is working fine when called through the ES dev console. However, when calling it from Java with the exact same parameters and same doc ID, I am not getting the expected results. The document simply remains unchanged.
Regardless of how the update happens exactly (which is using our own Kafka based update pipelines): What are good approaches to debug such a stored script? How can I log debug output and exceptions and where exactly would these log messages be showing up? Thanks!
final Map<String, Object> params = <my parameters here>;
final Script script = new Script(ScriptType.STORED, null, MY_SCRIPT_NAME, params);
UpdateRequest updateRequest = new UpdateRequest(MY_INDEX_NAME, ES_ID_OF_DOC).script(script);
// updateRequest then sent to ES via Kafka or via BulkIndexService
// neither of which leads to the desired doc update