The defaultSolrIndexConfiguration
node is located under: .\App_Config\Sitecore\ContentSearch\Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config
You could create a custom index configuration node that is referenced by your custom index.
Warning: Don't do this for any of the out-of-the-box indexes since Sitecore relies on those index configurations to run properly.
Example
If I were to create a custom index for blog articles named sitecore_blog_master_index
, my index configuration would look something like this
(pay attention to the configuration/sitecore/contentSearch/configuration/indexes/index/configuration
node):
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
<sitecore role:require="Standalone or ContentManagement" search:require="solr">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="sitecore_blog_master_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">$(id)</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/blogSolrIndexConfiguration">
<enableReadAccessIndexing>true</enableReadAccessIndexing>
</configuration>
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" role:require="ContentManagement and !Indexing" />
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/intervalAsyncMaster" role:require="Standalone or (ContentManagement and Indexing)" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>master</Database>
<Root>/sitecore</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
You'd need to make sure to define your blogSolrIndexConfiguration
element. You've got two options for this.
Option 1
The easiest thing to do is copy the defaultSolrIndexConfiguration
element that I referenced above into your custom index config file, changing the element name to blogSolrIndexConfiguration
. This results in a lot of duplicated configuration that makes your index harder to support in the future.
Option 2
Another solution would be to use the ref
attribute to reference the subelements from the defaultSolrIndexConfiguration
in your blogSolrIndexConfiguration
. It would look something like this:
<sc.variable name="defaultSolrIndexConfiguration"
value="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/" />
<blogSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider">
<initializeOnAdd ref="$(defaultSolrIndexConfiguration)initializeOnAdd" />
<fieldMap ref="$(defaultSolrIndexConfiguration)fieldMap"/>
<mediaIndexing ref="$(defaultSolrIndexConfiguration)mediaIndexing"/>
<virtualFields ref="$(defaultSolrIndexConfiguration)virtualFields"/>
<fieldReaders ref="$(defaultSolrIndexConfiguration)fieldReaders"/>
<indexFieldStorageValueFormatter ref="$(defaultSolrIndexConfiguration)indexFieldStorageValueFormatter"/>
<indexDocumentPropertyMapper ref="$(defaultSolrIndexConfiguration)indexDocumentPropertyMapper"/>
<documentBuilderType ref="$(defaultSolrIndexConfiguration)documentBuilderType"/>
<defaultSearchSecurityOption ref="contentSearch/indexConfigurations/defaultSearchSecurityOption" />
<enableReadAccessIndexing ref="contentSearch/indexConfigurations/enableReadAccessIndexing" />
<searchOptions ref="$(defaultSolrIndexConfiguration)searchOptions"/>
<highlightOptions ref="$(defaultSolrIndexConfiguration)highlightOptions"/>
<documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
{{Custom Configuration Goes Here}}
</documentOptions>
</blogSolrIndexConfiguration>
This minimizes the duplication of configuration, allowing you to define specifically what's custom to your solution.