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 hemanth <k....@gmail.com> on 2017/12/26 07:39:22 UTC

RE: help on implicit routing

I am trying here implicit routing and want to create a collection with 3
shards with names Active,Inactive and Terminated.  I created a _route_ field
in schema and copied my status field which contains Active or Inactive or
Terminated. I used copyfield in schema.xml to copy from status to _route_. I
specified _route_ as my route field in my implicit routing , while creating
a collection with implicit routing and shard names as Active,Inactive and
Terminated. But all my documents are still going to the same shard. Any hits
are highly appreciated.

Thanks
Hemanth



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: help on implicit routing

Posted by Erick Erickson <er...@gmail.com>.
copyField is _much_ too late. That only happens _after_ the doc lands
on a shard, i.e. after it's been routed. The routing field must be
populated before that stage.

Why are you bothering with the _route_ field anyway? It's unnecessary.

First of all, the name of the shard must match the value in the field.
By default, shards are created with names like "shard1", "shard2" etc.
_that's_ the value you need to route by, not "Active". How would you
expect Solr to understand that you want all fields with "Active" in
some field to go to "shard1"?

Or you can create a collection with no shards and use the CREATESHARD
collections API command to give a shard a name like "Active". And
specify the routing field at collection creation time. And do away
with the whole copyField bits.

If you're still stuck you need to stop telling us what you're doing
and show us. I.e.
1> give the exact command(s) you use to create the collection
2> show a document you expect to be routed
3> show the relevant portions of your schema

You might review:
https://wiki.apache.org/solr/UsingMailingLists

Best,
Erick

On Mon, Dec 25, 2017 at 11:39 PM, hemanth <k....@gmail.com> wrote:
> I am trying here implicit routing and want to create a collection with 3
> shards with names Active,Inactive and Terminated.  I created a _route_ field
> in schema and copied my status field which contains Active or Inactive or
> Terminated. I used copyfield in schema.xml to copy from status to _route_. I
> specified _route_ as my route field in my implicit routing , while creating
> a collection with implicit routing and shard names as Active,Inactive and
> Terminated. But all my documents are still going to the same shard. Any hits
> are highly appreciated.
>
> Thanks
> Hemanth
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html