lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Does Solr move documents between shards when the value of the shard key is updated ?
Date Tue, 01 Jul 2014 21:24:49 GMT
You would end up with duplicate docs on the two shards.

Solr is doing its doc-id lookup on the shards, not on
other shards. Routing takes place before this step,
so you're going to have two docs.


On Tue, Jul 1, 2014 at 9:42 AM, IJ <> wrote:
> Lets say I create a Solr Collection with multiple shards (say 2 shards) and
> set the value of "router.field" to a field called "CompanyName". Now - we
> all know that during Indexing Solr would compute a hash on the value indexed
> into the "CompanyName" and route to an appropriate shard.
> Lets say I index a document into this Collection - and Solr routes the
> document into Shard 1 (based on the computed Hash). Now, lets say - I
> re-index the same document (same unique key) - but with a different value of
> the "CompanyName" - and lets say the Solr now determines that the document
> should route to Shard 2 - In such a situation - would solr delete the older
> version of the document from Shard 1 ? OR would I end up with two versions
> of the same Document (same unique key) in both shards ?
> My system allows updates to fields that I choose as the shard key. I
> definitely want the document to be moved from Shard 1 into Shard 2 when i
> perform the re-indexing. Would this work as expected ? OR should I be doing
> an explicit delete prior to re-indexing such documents ??
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

View raw message