elasticsearch-java
elasticsearch-java copied to clipboard
java.lang.IllegalArgumentException: Class class co.elastic.clients.elasticsearch.core.bulk.UpdateOperation cannot be read from JSON
Java API client version
8.5.3 and 8.4.1
Java version
jdk11
Elasticsearch Version
8.4.1
Problem description
java.lang.IllegalArgumentException: Class class co.elastic.clients.elasticsearch.core.bulk.UpdateOperation cannot be read from JSON
StringReader reader = new StringReader(json);
BulkOperation updateOp = new BulkOperation.Builder()
.update(new UpdateOperation.Builder<>()
.index(topic)
.id("1")
.withJson(reader)
.retryOnConflict(Math.min(1, 5))
.build())
.build();
@lucky-xin did you find a solution to this?
Would it be possible to add the implementation for .withJson on the UpdateOperation?
I have a pre-serialized JSON as well that I'd want to pass to my UpdateOperation but neither .withJson
works nor using
.action(UpdateAction.of(ua -> ua.doc(BinaryData.of(jsonBytes, contentType)))