I am using ES1.4.4 and wanted to run an update script with the Update API that iterated over a ctx._source.nested_object and updated only the nested objects that fulfilled the requirements of the script. It seems relatively very simple but for some reason I am not getting an update.
script : 'for(i in ctx._source.nested_object){ if(ctx._source.nested_object[i].user.id == id){ ctx._source.nested_object[i].user = merge } }',
params : { "id" : "SEL123" , "merge" : { "key1" : "value1" } }
All the fields that are being added/set to the new object match the field types of the existing source. Scripts are enabled in my cluster instance. The script language is Groovy.