My scripted update produces the following noop
response since the condition was not met:
/my_idx/_update/my_doc_id
{
"_index": "my_idx",
"_type": "_doc",
"_id": "my_doc_id",
"_version": 4,
"result": "noop",
"_shards": {
"total": 0,
"successful": 0,
"failed": 0
}
}
However, this response could not be deserialized to UpdateResponse<TDocument>
by the elasticsearch-java
client due to the constraints imposed by its super constructor in WriteResponseBase
, specifically around primaryTerm
and seqNo
, which are clearly missing in a noop
update response:
protected WriteResponseBase(AbstractBuilder<?> builder) {
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
this.primaryTerm = ApiTypeHelper.requireNonNull(builder.primaryTerm, this, "primaryTerm");
this.result = ApiTypeHelper.requireNonNull(builder.result, this, "result");
this.seqNo = ApiTypeHelper.requireNonNull(builder.seqNo, this, "seqNo");
this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards");
this.type = builder.type;
this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version");
this.forcedRefresh = builder.forcedRefresh;
}
The version of my Java client is 8.4.2
, while the server instance version is 7.2.0
. I've already had to do some hacks to get these two versions to work together. I am wondering if these missing fields were indeed optional in 7.2.0
. Unfortunately, I have no way of checking because they only have tags from 7.15.0
in Github.
Is there any workaround, or is catching the resulting exception and handling it (hoping it's because of the noop
) the only way to get it to work?