I wanna update one of the fields with new value In the document. The type of new value is JSON. I send a String parameter it works but when I send JSON it has an error.
UpdateResponse response = dataTransportClient.prepareUpdate(
index,
type,
docId)
.setScript(
new Script(
ScriptType.INLINE,
"painless",
"ctx._source.response =" + "\"" + result + "\"",
Collections.emptyMap()
)
)
.setRefreshPolicy(WriteRequest.RefreshPolicy.NONE)
.get();