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 Markus Jelsma <ma...@openindex.io> on 2016/04/28 13:29:42 UTC
Set router.field in unit tests
Hi - i'm working on a unit test that requires the cluster's router.field to be set to a field different than ID. But i can't find it?! How can i set router.field with AbstractFullDistribZkTestBase?
Thanks!
Markus
Re: Set router.field in unit tests
Posted by Alan Woodward <al...@flax.co.uk>.
It's almost certainly worth using SolrCloudTestBase rather than AbstractDistribZkTestBase as well - normally makes the test five or six times faster.
Alan Woodward
www.flax.co.uk
On 29 Apr 2016, at 17:11, Erick Erickson wrote:
> I'm pretty sure you can just create a collection after the distributed
> stuff is set up.
>
> Take a look at:
>
> CollectionsAPIDistributedZkTest.testNodesUsedByCreate to see creating
> a collection
> in your test just by a request (you can set any params you want there, including
> router.field).
>
> Or CollectionsAPISolrJTest.testCreateAndDeleteCollection for a niftier
> builder pattern
> SolrJ way.
>
> Best,
> Erick
>
> On Fri, Apr 29, 2016 at 5:34 AM, GW <th...@gmail.com> wrote:
>> Not exactly suer what you mean but I think you are wanting to change your
>> schema.xml
>>
>> <field name="id" type="string" indexed="true" stored="true" required="true"
>> multiValued="false" />
>>
>> to
>>
>> <field name="newvalue" type="string" indexed="true" stored="true"
>> required="true" multiValued="false" />
>>
>>
>> restart solr
>>
>>
>> On 29 April 2016 at 06:04, Markus Jelsma <ma...@openindex.io> wrote:
>>
>>> Hi - any hints to share?
>>>
>>> Thanks!
>>> Markus
>>>
>>>
>>>
>>> -----Original message-----
>>>> From:Markus Jelsma <ma...@openindex.io>
>>>> Sent: Thursday 28th April 2016 13:30
>>>> To: solr-user <so...@lucene.apache.org>
>>>> Subject: Set router.field in unit tests
>>>>
>>>> Hi - i'm working on a unit test that requires the cluster's router.field
>>> to be set to a field different than ID. But i can't find it?! How can i set
>>> router.field with AbstractFullDistribZkTestBase?
>>>>
>>>> Thanks!
>>>> Markus
>>>>
>>>
Re: Set router.field in unit tests
Posted by Erick Erickson <er...@gmail.com>.
I'm pretty sure you can just create a collection after the distributed
stuff is set up.
Take a look at:
CollectionsAPIDistributedZkTest.testNodesUsedByCreate to see creating
a collection
in your test just by a request (you can set any params you want there, including
router.field).
Or CollectionsAPISolrJTest.testCreateAndDeleteCollection for a niftier
builder pattern
SolrJ way.
Best,
Erick
On Fri, Apr 29, 2016 at 5:34 AM, GW <th...@gmail.com> wrote:
> Not exactly suer what you mean but I think you are wanting to change your
> schema.xml
>
> <field name="id" type="string" indexed="true" stored="true" required="true"
> multiValued="false" />
>
> to
>
> <field name="newvalue" type="string" indexed="true" stored="true"
> required="true" multiValued="false" />
>
>
> restart solr
>
>
> On 29 April 2016 at 06:04, Markus Jelsma <ma...@openindex.io> wrote:
>
>> Hi - any hints to share?
>>
>> Thanks!
>> Markus
>>
>>
>>
>> -----Original message-----
>> > From:Markus Jelsma <ma...@openindex.io>
>> > Sent: Thursday 28th April 2016 13:30
>> > To: solr-user <so...@lucene.apache.org>
>> > Subject: Set router.field in unit tests
>> >
>> > Hi - i'm working on a unit test that requires the cluster's router.field
>> to be set to a field different than ID. But i can't find it?! How can i set
>> router.field with AbstractFullDistribZkTestBase?
>> >
>> > Thanks!
>> > Markus
>> >
>>
Re: Set router.field in unit tests
Posted by GW <th...@gmail.com>.
Not exactly suer what you mean but I think you are wanting to change your
schema.xml
<field name="id" type="string" indexed="true" stored="true" required="true"
multiValued="false" />
to
<field name="newvalue" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
restart solr
On 29 April 2016 at 06:04, Markus Jelsma <ma...@openindex.io> wrote:
> Hi - any hints to share?
>
> Thanks!
> Markus
>
>
>
> -----Original message-----
> > From:Markus Jelsma <ma...@openindex.io>
> > Sent: Thursday 28th April 2016 13:30
> > To: solr-user <so...@lucene.apache.org>
> > Subject: Set router.field in unit tests
> >
> > Hi - i'm working on a unit test that requires the cluster's router.field
> to be set to a field different than ID. But i can't find it?! How can i set
> router.field with AbstractFullDistribZkTestBase?
> >
> > Thanks!
> > Markus
> >
>
RE: Set router.field in unit tests
Posted by Markus Jelsma <ma...@openindex.io>.
Hi - any hints to share?
Thanks!
Markus
-----Original message-----
> From:Markus Jelsma <ma...@openindex.io>
> Sent: Thursday 28th April 2016 13:30
> To: solr-user <so...@lucene.apache.org>
> Subject: Set router.field in unit tests
>
> Hi - i'm working on a unit test that requires the cluster's router.field to be set to a field different than ID. But i can't find it?! How can i set router.field with AbstractFullDistribZkTestBase?
>
> Thanks!
> Markus
>