You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by bbarani <bb...@gmail.com> on 2013/06/06 01:58:00 UTC

How to update a particular document on multi-shards configuration?

I have 5 shards that has different data indexed in them (each document has a
unique id).

Now when I perform dynamic updates (push indexing) I need to update the
document corresponding to the unique id that is needs to be updated but I
wont know which core that corresponding document is present in. 

I can do a search across all the shards for that unique id and get back the
document but I am not sure how to get the core information corresponding to
that document (unless I index that info, also this method requires one extra
search to find the document). 

Is there a way to automatically push the document to proper core based on
unique id? I am  not using solrcloud yet, just the basic sharding. I know
this might not be possible without solrcloud feature, just thought of
getting your inputs..



--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-update-a-particular-document-on-multi-shards-configuration-tp4068476.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to update a particular document on multi-shards configuration?

Posted by Jack Krupansky <ja...@basetechnology.com>.
That's what SolrCloud was invented for - fully-distributed indexing where 
any update can be sent to any node.

With non-SolrCloud distributed Solr, YOU, the developer are responsible for 
figuring out what node a document should be sent to, both for updates and 
for the original insertion. The point is that you get to decide how the node 
will be chosen.

So, go ahead and come up with your own function that takes one of your 
unique keys and generates a shard number. A simple approach is to hash the 
key, and take the low bits modulo the number of shards.

-- Jack Krupansky

-----Original Message----- 
From: bbarani
Sent: Wednesday, June 05, 2013 7:58 PM
To: solr-user@lucene.apache.org
Subject: How to update a particular document on multi-shards configuration?

I have 5 shards that has different data indexed in them (each document has a
unique id).

Now when I perform dynamic updates (push indexing) I need to update the
document corresponding to the unique id that is needs to be updated but I
wont know which core that corresponding document is present in.

I can do a search across all the shards for that unique id and get back the
document but I am not sure how to get the core information corresponding to
that document (unless I index that info, also this method requires one extra
search to find the document).

Is there a way to automatically push the document to proper core based on
unique id? I am  not using solrcloud yet, just the basic sharding. I know
this might not be possible without solrcloud feature, just thought of
getting your inputs..



--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-update-a-particular-document-on-multi-shards-configuration-tp4068476.html
Sent from the Solr - User mailing list archive at Nabble.com.