lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ketan Thanki <ktha...@asite.com>
Subject RE: How to routing document for send to particular shard range
Date Fri, 10 Nov 2017 14:07:44 GMT
Thanks Amrit,

I getting it know so can you please told me anyhow can I achieve using composite routing ?
 as mentions my requirement below.

Because will need to send particular client data to particular shard.

Regards,


-----Original Message-----
From: Amrit Sarkar [mailto:sarkaramrit2@gmail.com] 
Sent: Friday, November 10, 2017 5:34 PM
To: solr-user@lucene.apache.org
Subject: Re: How to routing document for send to particular shard range

Ketan,

here I have also created new field 'core' which value is any shard where I
> need to send documents and on retrieval use '_route_'  parameter with 
> mentioning the particular shard. But issue facing still my 
> clusterstate.json showing the "router":{"name":"compositeId"} is it 
> means my settings not impacted? or its default.


Only answering this query, as Erick has already mentioned in the above comment. You need to
RECREATE the collection passinfg the "route.field" in the "create collection" api parameters
as "route.field" is collection-specific property maintained at zookeeper (state.json / clusterstate.json).

https://lucene.apache.org/solr/guide/6_6/collections-api.html#CollectionsAPI-create

I highly recommend not to alter core.properties manually when dealing with SolrCloud and instead
relying on SolrCloud APIs to make necessary change.

Amrit Sarkar
Search Engineer
Lucidworks, Inc.
415-589-9269
www.lucidworks.com
Twitter http://twitter.com/lucidworks
LinkedIn: https://www.linkedin.com/in/sarkaramrit2
Medium: https://medium.com/@sarkaramrit2

On Fri, Nov 10, 2017 at 5:23 PM, Ketan Thanki <kthanki@asite.com> wrote:

> Hi Erik,
>
> My requirement to index the documents of particular organization to 
> specific shard. Also I have made changes in core.properties as menions 
> below.
>
> Model Collection:
> name=model
> shard=shard1
> collection=model
> router.name=implicit
> router.field=core
> shards=shard1,shard2
>
> Workset Collection:
> name=workset
> shard=shard1
> collection=workset
> router.name=implicit
> router.field=core
> shards=shard1,shard2
>
> here I have also created new field 'core' which value is any shard 
> where I need to send documents and on retrieval use '_route_'  
> parameter with mentioning the particular shard. But issue facing still 
> my clusterstate.json showing the "router":{"name":"compositeId"} is it 
> means my settings not impacted? or its default.
>
> Please do needful.
>
> Regards,
>
> -----Original Message-----
> From: Erick Erickson [mailto:erickerickson@gmail.com]
> Sent: Friday, November 10, 2017 12:06 PM
> To: solr-user
> Subject: Re: How to routing document for send to particular shard 
> range
>
> You cannot just make configuration changes, whether you use implicit 
> or compositeId is defined when you _create_ the collection and cannot 
> be changed later.
>
> You need to create a new collection and specify router.name=implicit 
> when you create it. Then you can route documents as you desire.
>
> I would caution against this though. If you use implicit routing _you_ 
> have to insure balancing. For instance, you could have 10,000,000 
> documents for "Org1" and 15 for "Org2", resulting in hugely unbalanced shards.
>
> Implicit routing is particularly useful for time-series indexing, 
> where you, say, index a day's worth of documents to each shard. It may 
> be appropriate in your case, but so far you haven't told us _why_ you 
> think routing docs to particular shards is desirable.
>
> Best,
> Erick
>
> On Thu, Nov 9, 2017 at 10:27 PM, Ketan Thanki <kthanki@asite.com> wrote:
> > Thanks Amrit,
> >
> > For suggesting me the approach.
> >
> > I have got some understanding regarding to it and i need to 
> > implement
> implicit routing for specific shard based. I have try by make changes 
> on core.properties. but it can't work So can you please let me for the 
> configuration changes needed. Is it need to create extra field for 
> document to rout?
> >
> > I have below configuration Collection created manually:
> > 1: Workset with 4 shard and 4 replica
> > 2: Model with 4 shard and 4 replica
> >
> >
> > For e.g Core.properties for 1 shard :
> > Workset Colection:
> > name=workset
> > shard=shard1
> > collection=workset
> >
> > Model Collection:
> > name=model
> > shard=shard1
> > collection=model
> >
> >
> > So can u please let me the changes needed in configuration for the
> implicit routing.
> >
> > Please do needful.
> >
> > Regards,
> >
> >
> > -----Original Message-----
> > From: Amrit Sarkar [mailto:sarkaramrit2@gmail.com]
> > Sent: Wednesday, November 08, 2017 12:36 PM
> > To: solr-user@lucene.apache.org
> > Subject: Re: How to routing document for send to particular shard 
> > range
> >
> > Ketan,
> >
> > If you know defined indexing architecture; isn't it better to use
> "implicit" router by writing logic on your own end.
> >
> > If the document is of "Org1", send the document with extra param*
> > "_route_:shard1"* and likewise.
> >
> > Snippet from official doc:
> > https://lucene.apache.org/solr/guide/6_6/shards-and-indexing-data-in
> > -s olrcloud.html#ShardsandIndexingDatainSolrCloud-DocumentRouting
> > :
> >
> > If you created the collection and defined the "implicit" router at 
> > the time
> >> of creation, you can additionally define a router.field parameter 
> >> to use a field from each document to identify a shard where the 
> >> document belongs. If the field specified is missing in the 
> >> document, however, the document will be rejected. You could also 
> >> use the _route_ parameter to name a specific shard.
> >
> >
> >
> > Amrit Sarkar
> > Search Engineer
> > Lucidworks, Inc.
> > 415-589-9269
> > www.lucidworks.com
> > Twitter http://twitter.com/lucidworks
> > LinkedIn: https://www.linkedin.com/in/sarkaramrit2
> > Medium: https://medium.com/@sarkaramrit2
> >
> > On Wed, Nov 8, 2017 at 11:15 AM, Ketan Thanki <kthanki@asite.com> wrote:
> >
> >> Hi,
> >>
> >> I have requirement now quite different as I need to set routing key 
> >> hash for document which confirm it to send to particular shard as 
> >> its
> range.
> >>
> >> I have solrcloud configuration with 4 shard  & 4 replica with below 
> >> shard range.
> >> shard1: 80000000-bfffffff
> >> shard2: c0000000-ffffffff
> >> shard3: 0-3fffffff
> >> shard4: 40000000-7fffffff
> >>
> >> e.g: below show the project  works in organization which is my 
> >> routing
> key.
> >> Org1= works for project1,project2
> >> Org2=works for project3
> >> Org3=works for project4
> >> Org4=project5
> >>
> >> So as mentions above I want to index org1 to shard1,org2 to
> >> shard2,org3 to
> >> shard3,org4 to shard4 meanwhile send it to particular shard.
> >> How could I manage compositeId routing to do this.
> >>
> >> Regards,
> >> Ketan.
> >> Please cast a vote for Asite in the 2017 Construction Computing Awards:
> >> Click here to 
> >> Vote<http://caddealer.com/concompawards/index.php?page=
> >> cca2017vote>
> >>
> >> [CC Award Winners!]
> >>
> >>
>
Mime
View raw message