Skip to content

ElasticSearch Documentation is wrong for update by query #43884

@yesnid

Description

@yesnid

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

Labels

:Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>docsGeneral docs changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions