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 Lukasz Kujawa <lu...@php.net> on 2013/04/02 14:01:18 UTC

Collection name via Collections API (Solr 4.x)

Hello,

I'm using Solr collections API to create a collection.

http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=2&collection.configName=default

I'm expecting new collection to be named "test2" what I get instead is
"test2_shard1_replica2". I don't want to tie my index name to any curent
settings. Is there any way to set collection name precisely? 

Thank you,
Lukasz




--
View this message in context: http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Collection name via Collections API (Solr 4.x)

Posted by Yago Riveiro <ya...@gmail.com>.
In this link you can see what is what http://wiki.apache.org/solr/SolrCloud#Glossary 

The collection represents a single index, the solrCores AKA core, encapsulates a single physical index, One or more make up a logical shard which make up a collection.

You can have a collection with the same name of the SolrCore if you want.

-- 
Yago Riveiro
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, April 2, 2013 at 1:53 PM, Anshum Gupta wrote:

> Also, I am assuming that the collection name in this case should be
> 'test2'. The replica names would be on the lines of what you've mentioned.
> Is that not the case?
> 
> 
> 
> On Tue, Apr 2, 2013 at 5:31 PM, Lukasz Kujawa <lukasz@php.net (mailto:lukasz@php.net)> wrote:
> 
> > Hello,
> > 
> > I'm using Solr collections API to create a collection.
> > 
> > 
> > http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=2&collection.configName=default
> > 
> > I'm expecting new collection to be named "test2" what I get instead is
> > "test2_shard1_replica2". I don't want to tie my index name to any curent
> > settings. Is there any way to set collection name precisely?
> > 
> > Thank you,
> > Lukasz
> > 
> > 
> > 
> > 
> > --
> > View this message in context:
> > http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155.html
> > Sent from the Solr - User mailing list archive at Nabble.com (http://Nabble.com).
> > 
> 
> 
> 
> 
> -- 
> 
> Anshum Gupta
> http://www.anshumgupta.net
> 
> 



Re: Collection name via Collections API (Solr 4.x)

Posted by Anshum Gupta <an...@anshumgupta.net>.
Also, I am assuming that the collection name in this case should be
'test2'. The replica names would be on the lines of what you've mentioned.
Is that not the case?



On Tue, Apr 2, 2013 at 5:31 PM, Lukasz Kujawa <lu...@php.net> wrote:

> Hello,
>
> I'm using Solr collections API to create a collection.
>
>
> http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=2&collection.configName=default
>
> I'm expecting new collection to be named "test2" what I get instead is
> "test2_shard1_replica2". I don't want to tie my index name to any curent
> settings. Is there any way to set collection name precisely?
>
> Thank you,
> Lukasz
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 

Anshum Gupta
http://www.anshumgupta.net

Re: Collection name via Collections API (Solr 4.x)

Posted by Yago Riveiro <ya...@gmail.com>.
I use solr with a similar propose, I'm understand that you want have control that as the sharing is done :) 

Regards.

-- 
Yago Riveiro
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, April 2, 2013 at 5:54 PM, Lukasz Kujawa wrote:

> Thank you for you answers Yriveiro. I'm trying to use Solr for a big SaaS
> platform. The reason why I want everything dynamic is each user will get own
> Solr collection. It looks like there are still many issues with the
> distributed computing. I hope 4.3 will arrive soon ;-) Anyway.. once again
> thank you for your time.
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155p4053245.html
> Sent from the Solr - User mailing list archive at Nabble.com (http://Nabble.com).
> 
> 



Re: Collection name via Collections API (Solr 4.x)

Posted by Lukasz Kujawa <lu...@php.net>.
Thank you for you answers Yriveiro. I'm trying to use Solr for a big SaaS
platform. The reason why I want everything dynamic is each user will get own
Solr collection. It looks like there are still many issues with the
distributed computing. I hope 4.3 will arrive soon ;-) Anyway.. once again
thank you for your time.



--
View this message in context: http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155p4053245.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Collection name via Collections API (Solr 4.x)

Posted by Yago Riveiro <ya...@gmail.com>.
Solr 4.2 implements a feature to proxy requests if the core not exists in node requested. https://issues.apache.org/jira/browse/SOLR-4210

Actually exists a bug in this mechanism https://issues.apache.org/jira/browse/SOLR-4584 

Without the proxy feature, creating the cores using manually or on automatic way, you only can query the collection in nodes that have least 1 replica of the collection.

If you have a solrCluster with 4 nodes and the collection only have 2 shards without replicas, then you can only query the collection in 50% of the cluster. (assuming that proxy request mechanism doesn't work properly)

When I said to create manually the collection, you need to create manually all shards that form the collection and the replicas in the others nodes of the cluster. It takes work, but if you want have some control you need to pay the price.

If it is possible that you can manage the name of shard with the collection API, the documentation doesn't say how.



-- 
Yago Riveiro
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, April 2, 2013 at 5:15 PM, Lukasz Kujawa wrote:

> l 


Re: Collection name via Collections API (Solr 4.x)

Posted by Lukasz Kujawa <lu...@php.net>.
If I use admin API instead of collection API according to my understanding
the new core will be only available on that server. If I will query
different solr server I will get an error. If I use collections API and I
query a server which physically doesn't hold the data I will still get
results. Creating cores "manually" across all Solr servers doesn't feel like
the right way to go.



--
View this message in context: http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155p4053230.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Collection name via Collections API (Solr 4.x)

Posted by Yago Riveiro <ya...@gmail.com>.
Collection API is a wrapper for the CORE API,

If you don't want that the API defines the name for you, then use the CORE API, you can define the collection name and the shard id.

curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=corename&collection=collection1&shard=XX'

-- 
Yago Riveiro
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, April 2, 2013 at 1:01 PM, Lukasz Kujawa wrote:

> Hello,
> 
> I'm using Solr collections API to create a collection.
> 
> http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=2&collection.configName=default
> 
> I'm expecting new collection to be named "test2" what I get instead is
> "test2_shard1_replica2". I don't want to tie my index name to any curent
> settings. Is there any way to set collection name precisely? 
> 
> Thank you,
> Lukasz
> 
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Collection-name-via-Collections-API-Solr-4-x-tp4053155.html
> Sent from the Solr - User mailing list archive at Nabble.com (http://Nabble.com).
> 
>