You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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));
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!
The text was updated successfully, but these errors were encountered:
Looks like the PR has been on hold since 2021; seems like the mods haven't provided a valid reason not to include these changes to the project. The solution I was thinking of is very close to this PR.
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!
The text was updated successfully, but these errors were encountered: