diff --git a/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java b/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java index c2b907acde44e..32f35d29a9e45 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java +++ b/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java @@ -118,11 +118,14 @@ public void testUpdateByQuery() { .filter(QueryBuilders.termQuery("level", "awesome")) .maxDocs(1000) .script(new Script(ScriptType.INLINE, - "ctx._source.awesome = 'absolutely'", "painless", + "ctx._source.awesome = 'absolutely'", Collections.emptyMap())); BulkByScrollResponse response = updateByQuery.get(); // end::update-by-query-filter + + // validate order of string params to Script constructor + assertEquals(updateByQuery.request().getScript().getLang(), "painless"); } { // tag::update-by-query-size @@ -152,16 +155,19 @@ public void testUpdateByQuery() { updateByQuery.source("source_index") .script(new Script( ScriptType.INLINE, + "painless", "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(); // end::update-by-query-script + + // validate order of string params to Script constructor + assertEquals(updateByQuery.request().getScript().getLang(), "painless"); } { // tag::update-by-query-multi-index