Solr core and collection What's the difference

I found I often use core and collection interchangeably without even notice. And in most cases it's indeed there are no obvious differences between the two.

In my mind, a core or a collection both simply refer to a Lucene index and a set of related Solr configuration files.

If I was using the Lucene API and do all stuff in Java code, there will be no confusions, there is just an index I need to interact with by Java program.

Solr is a wrapper on top of Lucene, it needs to build it's own abstraction about data store.

At its early stage, Solr only supports one Lucene index, Solr will deal with the low level details about Lucene, the job is done in a singleton class SolrCore, which means the core of Solr is about calling Lucene API to interact with a single index.

As the features of Solr get more complicated, cloud, multiple indexes and distributed search were introduced as the development goes. The core feature of Solr obviously not limited in single index. But the name stays.

In distributed search and index, a logical index may be distributed in many machines, each machine stores a part of the whole index, the part needs all the features that an old Solr core has, so the small part index still called a core. And the whole index is referred with a new name called "collection".

Many beginners start with a single index on one machine, makes the difference not so obvious, because there is just one collection that contains one core that manages the whole index of the collection.

Put it simply, a core is always about a very concrete index, it can be a whole index, or a small part of a large index. Most of a core comes from the old SolrCore singleton class. A collection is about a cluster in which a large index is distributed across many machines. But they constitute a logical index.

As you can see if you have different kind of data to index you should create different collection for them. But when your collections only have one core, there are no much differences, because creating core is the same as creating collection.