Search code examples
solrsolrj

Atomic Updates in Solr - multiple shards


We are currently working on atomic update feature in solr using solrJ. Will solr update the record correctly if it is distributed across shards?

If the record is in shard2, will it be updated or it will create new record in shard1?


Solution

  • If you're handling the sharding yourself, you'll have to update the exact shard in question (as you're the one responsible for distributing documents).

    If you're using Solr in SolrCloud mode, Solr will route the document to the correct shard for you, based on the document routing strategy.