@@ -118,11 +118,14 @@ public void testUpdateByQuery() {
118118 .filter (QueryBuilders .termQuery ("level" , "awesome" ))
119119 .maxDocs (1000 )
120120 .script (new Script (ScriptType .INLINE ,
121- "ctx._source.awesome = 'absolutely'" ,
122121 "painless" ,
122+ "ctx._source.awesome = 'absolutely'" ,
123123 Collections .emptyMap ()));
124124 BulkByScrollResponse response = updateByQuery .get ();
125125 // end::update-by-query-filter
126+
127+ // validate order of string params to Script constructor
128+ assertEquals (updateByQuery .request ().getScript ().getLang (), "painless" );
126129 }
127130 {
128131 // tag::update-by-query-size
@@ -152,16 +155,19 @@ public void testUpdateByQuery() {
152155 updateByQuery .source ("source_index" )
153156 .script (new Script (
154157 ScriptType .INLINE ,
158+ "painless" ,
155159 "if (ctx._source.awesome == 'absolutely') {"
156160 + " ctx.op='noop'"
157161 + "} else if (ctx._source.awesome == 'lame') {"
158162 + " ctx.op='delete'"
159163 + "} else {"
160164 + "ctx._source.awesome = 'absolutely'}" ,
161- "painless" ,
162165 Collections .emptyMap ()));
163166 BulkByScrollResponse response = updateByQuery .get ();
164167 // end::update-by-query-script
168+
169+ // validate order of string params to Script constructor
170+ assertEquals (updateByQuery .request ().getScript ().getLang (), "painless" );
165171 }
166172 {
167173 // tag::update-by-query-multi-index
0 commit comments