Elasticsearch how to use a script(file) in an update Elasticsearch how to use a script(file) in an update elasticsearch elasticsearch

Elasticsearch how to use a script(file) in an update


EDIT: Elasticsearch has changed a lot since this answer (from documentation). Please refer to up-to-date documentation instead e.g. https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#_indexed_scripts

i am pretty sure this question is no longer relevant, but in case someone is interested still here goes:

the "script" field in the json should be an actual script not the name of a script. in your case script_id would be correct, also the name of the language should be added unless the default has been changed.

curl -XPOST 'http://localhost:9200/customer92/listbuilder/a10/_update' -d '{ "script_id":"summarization", "lang": "groovy"}'

for more details see: Indexed Scripts and Update API