On 2/2/2015 1:08 AM, Avanish Raju wrote:
> I'm learning to create collections by http for a new solr instance. To
> create a new collection called "*user6*", I tried the following:
> http://104.154.50.127:8983/solr/admin/collections?action=CREATE&name=*user6*
> &numShards=1&replicationFactor=2&property.instanceDir=*user6*&property.name=
> *user6*
> 
> However, when I look at the status, instanceDir and dataDir are all fine,
> but the core name is instead: user6_shard1_replica1

This is exactly how Solr is designed to work.  Without this naming
scheme, it is impossible to host multiple shards for the same collection
on a single Solr instance, a feature that *many* users require.

I believe that in Solr 4.0.0, as well as the 4.0-ALPHA and 4.0-BETA
releases, the collections API actually would name all of the cores for a
collection with the same name as the collection, because it expected
them to all be on separate hosts.  Later releases use the naming scheme
you have encountered.

It is usually not a good idea to override the core naming that the
collections API creates (or the instanceDir/dataDir), but if you really
want to, and you understand all the ramifications completely, you can
use the Core Admin API to create the collection yourself manually.

http://wiki.apache.org/solr/SolrCloud#Creating_cores_via_CoreAdmin

Even with the XXXX_shardN_replicaM naming syntax for cores, you can
still use the collection name in requests, like this.  Such requests can
be sent to any solr instance in the cloud, and they will work properly:

http://server:port/solr/user6/select?q=foo

Thanks,
Shawn

Reply via email to