I am using Jest Java HTTP Rest client for Elasticsearch to do crud operations.
I have script update to update elastic search document. below is my script sample
String script = "{\n" +
" \"script\" : \"ctx._source.indicator = tag\",\n" +
" \"params\" : {\n" +
" \"tag\" : \"P\"\n" +
" }\n" +
"}";
and using jest update api, I am able to update document. See below.
jestClient.execute(new Update.Builder(script).index(indexName).type("I").id(documentId).build());
I also added script.inline=true in my elastic search yml file without which script update mention above won't work.
This update operation works perfectly with Elastic Search 2.x version but recently we upgraded Elastic Search from 2.x to 5.x and now my Elastic Search documents are not getting updated.
Recently I have generated the mentioned script above with the help of Elastic Search helper class to create JSON. Below is my JSON that is going to Elastic Search server
{
"script" : {
"source": "ctx._source.requeue_parent_child_indicator =
params.requeueIndicator",
"lang": "painless",
"params" : {
"requeueIndicator" : "P"
}
}
}
This script works when executed through latest kibana dev tool. My elastic search document is getting updated but it is not updating through JEST API (Update Builder)