Java API update document

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();

Found the below code on this link, this might help
http://elasticsearch-users.115913.n3.nabble.com/Update-Api-in-java-td4021000.html

Example showing how to update a title field:
Node node = nodeBuilder().client(true).node();
Client client = node.client();
String index = "my_index";
String type= "my_type";
String id = "1";
String newTitle = "my new title";
client.prepareUpdate(index, type, id)
.setScript("ctx._source.title="" + newTitle + """)
.execute()
.actionGet();