Sitecore 10 Configuration Reference in Custom Solr Collections
When creating a custom Solr index, such as a Preview index tied to a new Preview database, you have two options on how to control the scope of what is indexed.
Contents
Option 1: defaultSolrIndexConfiguration
If you have a custom index that mirrors the out of the box web database (which is the common case when creating a custom Preview index), you can use the same configuration as web. Inside your SwitchOnRebuild configuration for the CM and the CD, set the following line:
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
You can view the default configuration options inside the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config located at the wwwroot\App_Config\Sitecore\ContentSearch path.
Option 2: customSolrIndexConfiguration
If you want your custom index tuned to only include templates required for the scope of your index and maybe some additional computed index fields, you can create your own by copying the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config located at the wwwroot\App_Config\Sitecore\ContentSearch path and modifying it to meet your needs.
This new file (ex. Sitecore.ContentSearch.Solr.PreviewIndexConfiguration.config) should live within your include directory. After you make the desired changes for which templates and/or computed index fields it should contain, reference this file properly in your custom index’s SwitchOnRebuild file by:
Changing the XML nodes to the correct name you want to reference
Anywhere you see defaultSolrIndexConfiguration, change it to the desired name such as previewSolrIndexConfiguration. Example:
<previewSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider">
Changing the configuration ref line of your custom index SwitchOnRebuild file
This should match the XML node you declared above. Example:
<configuration ref="contentSearch/indexConfigurations/previewSolrIndexConfiguration" />