Wednesday, November 8, 2017

Sitecore SOLR creating a core for your custom search index

After installing SOLR and connecting it to your Sitecore 9 instance, you may notice that a number of default Sitecore default cores have been added. In SOLR a core is an instance of a Lucene index and contains the configurations for that index. Each index should have it's own core, so for each custom index you wish to create for Sitecore, you must create a core.

To create your SOLR core, in the browser navigate to the SOLR instance. In my case the URL is: https://solr-dev.local:8983/solr/, however the hostname is configured at installation. On the left hand navigation menu, select the Core Admin option, here a list of the default cores are listed.

SOLR default Sitecore cores
Instead of using the GUI to create the core, the following URL will work (which allows the creation of cores to be scripted):
https://solr-dev.local:8983/solr/admin/cores?action=CREATE&name=TEST_CORE&instanceDir=TEST_CORE&configSet=basic_configs
 This has the following parameters:

  • Action - action to perform on the given core
  • Name - name of the core
  • InstanceDir - Folder name for the core
  • ConfigSet - allows configurations to be shared between a number of cores. This is the default that Sitecore indexes use.
Once created, your core is now ready to use:

SOLR new core added
Which is referenced in the XML definition of your custom SOLR index:

SOLR index configuration, core element

No comments:

Post a Comment