Hi Shamik,

Your assumptions on that are correct.

As far as explicit '/8' at query time is concerned, that's the only
way the router would get to know that it's a 3-level id and not a
2-level one i.e. e.g.

shard.keys='myapp!'
Hash range to be fetched: <first-16 bits of murmur hash of myapp>0000
to <first-16 bits of murmur hash of myapp>ffff
Intended Hash Range: <8 bits from the hash of myapp>000000 to <8 bits
from hash of myapp>ffffff (larger range).

If you don't specify a '/8', it will operate as a regular composite id
and try to use 16 bits from the 1st component instead of the intended
8 (in case of tri-level).

Does that make sense?

On Mon, May 19, 2014 at 5:06 PM, Shamik Bandopadhyay <sham...@gmail.com> wrote:
> Hi,
>
>   Need some clarification on multilevel composite-id routing in SolrCloud
> .I'm currently composite id routing using the following pattern *topic!url* .
> This is aimed at run-time de-duplication based on topic field. As I'm
> adding support for language search, I felt the need to include language
> parameter for better multi-tenancy. Here's the new key structure I'm
> thinking of --> *language!topic!url*.
> An example would be : english!12345!www.testurl.com
>
> Now, during query time, I'll always have language parameter at my disposal.
> I was thinking,of leveraging the shard.key parameter to specify
> *shard.keys=language!
> *, which will route the request to the right shard and bring back english
> content. Is this a valid assumption ?
>
> Also, as per my understanding, the three fields will default to 8,8 and 16
> bits of the routing hash. What'll be a valid scenario for providing
> a custom allocation of bits for these fields. I was referring to the
> following article http://searchhub.org/2014/01/06/10590/ , but was not
> entirely sure on this section.
>
>
> *At query time:*
>
> *To query all records for myapp: shard.keys=myapp/8!*
>
> *Note the explicit mention of 8 bits in case of querying by component 1
> only i.e. app level. This is required because the usage of the router as 2
> or 3 level isn’t implicit. Specifying ’8′ bits for the component highlights
> the use of ’3′ level router*.
> Any feedback will be much appreciated.
>
> Thanks,
> Shamik



-- 

Anshum Gupta
http://www.anshumgupta.net

Reply via email to