Updatequery.builder only has withscript(string script) function to send the script source , how to send the script id in case of stored script? . I am using spring data elasticsearch 4.1. Thanks
Edit to show the error with Spring data elasticsearch 4.2.1
Map<String,Object> params = new HashMap<>(); params.put("message","this is a test message to test");
UpdateQuery updateQuery = UpdateQuery.builder(Query.findAll()).withScriptType(ScriptType.STORED) .withScriptName("updateScript01").withParams(params).build(); this.elasticsearchRestTemplate(updateQuery,IndexCoordniates.of("sampleIndex1"));
exception: Caused by: org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: id is missing;2: script or doc is missing; at org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:26) at org.elasticsearch.action.update.UpdateRequest.validate(UpdateRequest.java:206)
Stored script in elasticsearch from kibana: POST _scripts/updateScript01 { "script": { "lang": "painless", "source": "ctx._source.message = params.message;" } }
