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 Rainer Gnan <Ra...@bsb-muenchen.de> on 2016/12/12 10:32:15 UTC
Solr 6.2.1 :: Collection Aliasing
Hi,
actually I am trying to use Collection Aliasing in a SolrCloud-environment.
My set up is as follows:
1. Collection_1 (alias "live") linked with config_1
2. Collection_2 (alias "test") linked with config_2
3. Collection_1 is different to Collection _2
4. config_1 is different to config_2
Case 1: Using
http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml&collection=test
leads to the same results as
http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml
which is correct.
Case 2: Using
http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml&collection=live
leads to the same result as
http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml
which is correct, too.
BUT
Case 3: Using
http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml&collection=live
leads NOT to the same result as
http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml&collection=live
or
http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml
It seems that using alias "live" in case 3 forces solr to search in Collection_1 (which is desired) but it uses config_2 of Collection_2 (which is not desired).
MY AIM IS:
Running one collection as productive and the other as test environment within a single SolrCloud.
After setting up a new index (new schema, new solrconfig.xml) on the test collection I want to asign the test collection the alias "live" and the live collection the alias "test".
How can I force solr to search in Collection_X with config_X?
I hope that my description makes clear what my problem is. If not, don't hesitate to ask, I appreciate any help.
Rainer
--------------------------------------------
Rainer Gnan
Bayerische Staatsbibliothek
BibliotheksVerbund Bayern
Verbundnahe Dienste
80539 München
Tel.: +49(0)89/28638-2445
Fax: +49(0)89/28638-2665
E-Mail: rainer.gnan@bsb-muenchen.de
--------------------------------------------
Re: Antw: Re: Solr 6.2.1 :: Collection Aliasing
Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/12/2016 3:56 AM, Rainer Gnan wrote:
> Do the query this way:
> http://hostname.de:8983/solr/live/select?indent=on&q=*:*
>
> I have no idea whether the behavior you are seeing is correct or wrong,
> but if you send the traffic directly to the alias it should work correctly.
>
> It might turn out that this is a bug, but I believe the above workaround
> should take care of the issue in your environment.
It's standard SolrCloud usage. You use the name of a collection in the
URL path after /solr, where normally (non-cloud) you would use a core
name. All aliases, even those with multiple collections, will work for
queries, and single-collection aliases would have predictable results
for updates. I do not have any documentation to point you at, although
it's possible that this IS mentioned in the docs.
Thanks,
Shawn
Antw: Re: Solr 6.2.1 :: Collection Aliasing
Posted by Rainer Gnan <Ra...@bsb-muenchen.de>.
Hi Shawn,
your workaround works and is exactly what I was looking for.
Did you find this solution via trial and error or can you point me to the appropriate section in the APRGuide?
Thanks a lot!
Rainer
--------------------------------------------
Rainer Gnan
Bayerische Staatsbibliothek
BibliotheksVerbund Bayern
Verbundnahe Dienste
80539 München
Tel.: +49(0)89/28638-2445
Fax: +49(0)89/28638-2665
E-Mail: rainer.gnan@bsb-muenchen.de
--------------------------------------------
>>> Shawn Heisey <ap...@elyograg.org> 12.12.2016 11:43 >>>
On 12/12/2016 3:32 AM, Rainer Gnan wrote:
> Hi,
>
> actually I am trying to use Collection Aliasing in a SolrCloud-environment.
>
> My set up is as follows:
>
> 1. Collection_1 (alias "live") linked with config_1
> 2. Collection_2 (alias "test") linked with config_2
> 3. Collection_1 is different to Collection _2
> 4. config_1 is different to config_2
>
> Case 1: Using
> http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml&collection=test
> leads to the same results as
> http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml
> which is correct.
>
> Case 2: Using
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml&collection=live
> leads to the same result as
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml
> which is correct, too.
>
> BUT
>
> Case 3: Using
> http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml&collection=live
> leads NOT to the same result as
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml&collection=live
> or
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml
Do the query this way:
http://hostname.de:8983/solr/live/select?indent=on&q=*:*
I have no idea whether the behavior you are seeing is correct or wrong,
but if you send the traffic directly to the alias it should work correctly.
It might turn out that this is a bug, but I believe the above workaround
should take care of the issue in your environment.
Thanks,
Shawn
Re: Solr 6.2.1 :: Collection Aliasing
Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/12/2016 3:32 AM, Rainer Gnan wrote:
> Hi,
>
> actually I am trying to use Collection Aliasing in a SolrCloud-environment.
>
> My set up is as follows:
>
> 1. Collection_1 (alias "live") linked with config_1
> 2. Collection_2 (alias "test") linked with config_2
> 3. Collection_1 is different to Collection _2
> 4. config_1 is different to config_2
>
> Case 1: Using
> http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml&collection=test
> leads to the same results as
> http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml
> which is correct.
>
> Case 2: Using
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml&collection=live
> leads to the same result as
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml
> which is correct, too.
>
> BUT
>
> Case 3: Using
> http://hostname.de:8983/solr/Collection_2/select?indent=on&q=*:*&wt=xml&collection=live
> leads NOT to the same result as
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml&collection=live
> or
> http://hostname.de:8983/solr/Collection_1/select?indent=on&q=*:*&wt=xml
Do the query this way:
http://hostname.de:8983/solr/live/select?indent=on&q=*:*
I have no idea whether the behavior you are seeing is correct or wrong,
but if you send the traffic directly to the alias it should work correctly.
It might turn out that this is a bug, but I believe the above workaround
should take care of the issue in your environment.
Thanks,
Shawn