-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.A catch all label for issues around indexing, updating and getting a doc by id. Not search.>docsGeneral docs changesGeneral docs changes
Description
The documentation on this page, is incorrect in that it shows the argument of the script and language being passed to the new Script constructor in reversed order.
UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("source_index") .script(new Script( ScriptType.INLINE, "if (ctx._source.awesome == 'absolutely') {" + " ctx.op='noop'" + "} else if (ctx._source.awesome == 'lame') {" + " ctx.op='delete'" + "} else {" + "ctx._source.awesome = 'absolutely'}", "painless", Collections.emptyMap())); BulkByScrollResponse response = updateByQuery.get();
Note that the correct order is ScriptType, Language, Code, Params.
Metadata
Metadata
Assignees
Labels
:Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.A catch all label for issues around indexing, updating and getting a doc by id. Not search.>docsGeneral docs changesGeneral docs changes