Saturday, March 17, 2018

FW: Implications of using implicit routing

-----Original Message-----
From: Chris Ulicny [mailto:culicny@iq.media]
Sent: 14 March 2018 20:57
To: solr-user <solr-user@lucene.apache.org>
Subject: Implications of using implicit routing

Hi all,

We've been looking at using implicit for one of our collections, and there
seems to be some weird behavior that we're not sure whether it was expected
or not.

Is it recommended to use a uniqueKey for implicit routing? Is the following
behavior intended?

We have encountered the following issue. Create a collection with two shards
(S1,S2), implicit routing, with "id" as uniqueKey, and router.field as
"routingfield". If we index

{"id":"id1","routingfield":"S1"}

It goes into shard S1. Then if we need to reindex the document with a
different "routingfield" value:

{"id":"id1","routingfield":"S2"}

It goes into shard S2. However, when you select the document in a query, it
seems that both of those documents exist, but get deduped on return since
selecting all documents only ever returns a single document. Adding [shard]
to the fl list results in the document coming from S1 some of the time and
S2 the rest.

Trying to use /get with just the id results in a NullReferenceException.
Adding the _route_ parameter in works, but both documents can be retrieved.

Thanks,
Chris

No comments:

Post a Comment