Is it possible to upsert a document with a particular routing parameter?
I have tried to manipulate the key to append ?_routing=${route} as a suffix, but it doesn't seem to work.
As far as the code goes, in RequestBuilder.java,
if (config.indexWriteMethod() == IndexWriteMethod.UPSERT) {
return new UpdateRequest().id(documentId)
.index(index)
.doc(payload, XContentType.JSON)
.upsert(payload, XContentType.JSON)
.docAsUpsert(true)
.retryOnConflict(Math.min(config.maxInFlightRequests(), 3));
This is what I understand is making the API request to OpenSearch.
Looking at the reference for this API, I find that there is an optional .routing() parameter.
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-update.html#_optional_arguments_3
From these information, I am assuming that setting the routing parameter is impossible as of now. If someone has been able to achieve this with the current state of this plugin, any help will be greatly appreciated. Happy Coding!
Is it possible to upsert a document with a particular routing parameter?
I have tried to manipulate the key to append ?_routing=${route} as a suffix, but it doesn't seem to work.
As far as the code goes, in RequestBuilder.java,
This is what I understand is making the API request to OpenSearch.
Looking at the reference for this API, I find that there is an optional .routing() parameter.
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-update.html#_optional_arguments_3
From these information, I am assuming that setting the routing parameter is impossible as of now. If someone has been able to achieve this with the current state of this plugin, any help will be greatly appreciated. Happy Coding!