Discussion:
Collection name via Collections API (Solr 4.x)
Lukasz Kujawa
2013-04-02 12:01:18 UTC
Permalink
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.
Yago Riveiro
2013-04-02 12:47:19 UTC
Permalink
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)
Post by Lukasz Kujawa
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).
Lukasz Kujawa
2013-04-02 16:15:35 UTC
Permalink
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.
Yago Riveiro
2013-04-02 16:39:01 UTC
Permalink
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)
l
Lukasz Kujawa
2013-04-02 16:54:24 UTC
Permalink
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.
Yago Riveiro
2013-04-02 17:17:07 UTC
Permalink
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)
Post by Lukasz Kujawa
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).
Anshum Gupta
2013-04-02 12:53:00 UTC
Permalink
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?
Post by Lukasz Kujawa
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
--
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
Yago Riveiro
2013-04-02 13:11:37 UTC
Permalink
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)
Post by Anshum Gupta
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?
Post by Lukasz Kujawa
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
--
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
Loading...