You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Manvay Singh <ma...@synkriom.com> on 2022/03/18 17:43:58 UTC

Updating documents in a collection that routes using the implicit router

Hi all,

While trying to update a document in a collection that uses the implicit
router I encountered a problem updating the field that I have specified as
the router.field

For context, I have a field named Status which is the router.field for my
collection. When I pass an update command to SOLR with the following as the
body: [{"Id":"1505","Status":{"set":"Cancelled"},"IsInterviewCancelled":{
"set":"Y"}}]

I use the /solr/collection/update route with
softCommit=true&_route_=NotScheduled

As the sample document is from the NotScheduled shard and i would like to
route the request to that shard as it is where the document is located.
However, when I submit the request I receive this error message
"No shard called ={set=Cancelled} in DocCollection"
From this I can see that solr is using the Status passed in the body to
route the request to the appropriate shard which is overriding the _route_
parameter.
My question is, is there any way to update the status field and move the
document from the shard it is in to the shard that corresponds to the newly
updated status. Or am I wrong in how I have designed this collection and I
should pick a more static field that will not be updated?

Kindest Regards,
Manvay Dangi