Update by script

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();