I have documents like:
{
MyProp: [\"lorem\", \"ipsum\", \"dolor\"]
... lots of stuff here ...
}
My documents can be quite big (but thes
Would a _bulk
update work for you?
POST test/type1/_bulk
{"update":{"_id":1}}
{"script":{"inline":"ctx._source.MyProp += new_param","params":{"new_param":"bla"},"lang":"groovy"}}
{"update":{"_id":2}}
{"script":{"inline":"ctx._source.MyProp += new_param","params":{"new_param":"bla"},"lang":"groovy"}}
{"update":{"_id":3}}
{"script":{"inline":"ctx._source.MyProp += new_param","params":{"new_param":"bla"},"lang":"groovy"}}
....
And you would also need to enable inline scripting for groovy
. What the above would do is to add a bla
value to the listed documents in MyProp
field. Of course, depending on your requirements many other changes can be performed in that script.