SXA Solr Core Master and Web Index Name Patch Config
Recently happened to install SXA 1.9 in my machine as per this blog. One of the good practices highlighted in the blog is to create a patch file to override the SXA-related Solr core names instead of overwriting the index names in the actual Sitecore.XA.Foundation.Search.Solr.config.
So, i decided to write the patch. Since this was implemented for the tac.corporate project that is part of the Sitecore fundamentals training, I added the patch to <web root>\App_Config\Include\TAC folder. In my case, it is C:\inetpub\wwwroot\tac.corporate\App_Config\Include\TAC folder.
This is how my patch looks -
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<contentSearch>
<configuration>
<indexes hint="list:AddIndex">
<index id="sitecore_sxa_master_index">
<param desc="core" patch:instead="param[@desc='core']">tac.corporate_sxa_master_index</param>
</index>
<index id="sitecore_sxa_web_index">
<param desc="core" patch:instead="param[@desc='core']">tac.corporate_sxa_web_index</param>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
Once i added the patch and browsed the showconfig.aspx, i could find the changes in the consolidated Sitecore Config file -
So, i decided to write the patch. Since this was implemented for the tac.corporate project that is part of the Sitecore fundamentals training, I added the patch to <web root>\App_Config\Include\TAC folder. In my case, it is C:\inetpub\wwwroot\tac.corporate\App_Config\Include\TAC folder.
This is how my patch looks -
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<contentSearch>
<configuration>
<indexes hint="list:AddIndex">
<index id="sitecore_sxa_master_index">
<param desc="core" patch:instead="param[@desc='core']">tac.corporate_sxa_master_index</param>
</index>
<index id="sitecore_sxa_web_index">
<param desc="core" patch:instead="param[@desc='core']">tac.corporate_sxa_web_index</param>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
Once i added the patch and browsed the showconfig.aspx, i could find the changes in the consolidated Sitecore Config file -
Comments
Post a Comment