On Wed, Jul 3, 2013 at 5:40 PM, slevytam <developm...@the10thfloor.com> wrote:
> Hi Yonik,
>
> Can you offer any insight as to how one might ensure that documents reside
> on the same shard as the document you'd like them to join.
>
> For example:
> I'd like to do a simple join of user actions to a specific document.  So, i
> would query for a list of documents and have the user actions on that
> document be attached for the current user.  ie. liked etc

The easiest way using the default document routing in solr cloud
(which is compositeId hashing), is to just use the same prefix on the
ID field for all related documents.  This will route them all to the
same shard.

for example, the following unique IDs will all be routed to the same shard:

user15!doc1
user15!whatever
user15!yeah

http://searchhub.org/2013/06/13/solr-cloud-document-routing/

Or you can use custom sharding and directly assign documents to
shards... but if the default compositeId solution works for you, use
that.

-Yonik
http://lucidworks.com

Reply via email to