Collection and cores and naming in SolrCloud

When migrating from Solr to SolrCloud, it’s important to use the correct terminology. In Solr (singleton), one could loosely get away with using the terms ‘collection’ and ‘core’ interchangeably as they may end up named the same. In SolrCloud, that is not the case. Let’s use the index, sitecore_master_index to help illustrate.

A collection is a complete logical index in a SolrCloud cluster.
Ex. The collection name could be sitecore_master_index.

A core is a segment of a collection. A collection could be segmented into one or more cores.
SolrCloud defaults to naming them in this fashion: [collection]_[shard]_[replica]

So, let’s say that the sitecore_master_index has been configured with numShards = 2 and replicationFactor = 3.

Here are the default core names (if the shard names aren’t not explicitly defined):

sitecore_master_index_shard1_replica1
sitecore_master_index_shard1_replica2
sitecore_master_index_shard1_replica3

sitecore_master_index_shard2_replica1
sitecore_master_index_shard2_replica2
sitecore_master_index_shard2_replica3

Upon creating a collection with no shard splitting and only one instance of the index (i.e. no replication), the name of the collection would remain sitecore_master_index and the core name defaults to sitecore_master_index_shard1_replica1.

Advertisements