Update by script

edit

Update by script

edit

The update API allows to update a document based on a script provided:

UpdateRequest updateRequest = new UpdateRequest("ttl", "doc", "1")
        .script("ctx._source.gender = \"male\"");
client.update(updateRequest).get();