Hello,
I need help to do update document with java api. I'm trying to build update with setScriptParams. Update fails with exception:
org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: script or doc is missing;
But with line setScript (commented setScriptParams) this works well.
I need to execute as name - value.
Thanks.
this is my code
String newTitle = "new title value";
HashMap<String, Object> scriptParams = new HashMap<String, Object>();
scriptParams.put("title", "new title");
scriptParams.put("description", "new description");
response = client.prepareUpdate().setIndex(ItemConstant.INDEX_ITEMS)
.setType(type)
.setId(id)
.setScriptParams(scriptParams)
//.setScript("ctx._source.title="" + newTitle + """)
.setRetryOnConflict(5)
.setRefresh(true)
.execute()
.actionGet();