Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch Java Client version (1.0.0) (Limited because higher versions required jdk 11)
Describe the issue:
I need to do a partial document update with OpenSearch Java Client API.
Something like this:
POST xx/_update/123
{
"doc": {
"dateLastModified":1682281110874,
"FR":"sss",
"someOtherId":12,
"EN":"sss"
}
}
Here is the Code to execute it:
public void updateAsync(@NotNull PK id, @NotNull String document) throws IOException {
openSearchAsyncClient.update(new UpdateRequest.Builder<T, String>()
.index(index)
.id(convertId(id))
.doc(document)
.build(), targetType);
}
I cannot seem to pass to it any other types of document than the Data Class.
To make it work with old code, I need to be able to provide it a string.
I cannot find any documentations on Update.
I get a OpenSearchException with this detailed message:
Request failed: [x_content_parse_exception] [1:8] [UpdateRequest] doc doesn’t support values of type: VALUE_STRING