Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch file to update Sitecore Index names to allow developers to share an Azure Search Service. Simply set the environment variable and drop this file in the "Include/zzz" folder
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<sc.variable name="environment" value="martin_dev_" />
<contentSearch>
<configuration>
<indexes>
<index id="sitecore_master_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_web_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_core_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_suggested_test_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_marketing_asset_index_master" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_marketing_asset_index_web" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_testing_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_fxm_master_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_fxm_web_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
@martinrayenglish
Copy link
Author

Note: There is a platform dependency on the "sitecore_marketingdefinitions_master" and "sitecore_marketingdefinitions_web" naming so those 2 indexes are excluded from the patch. In a development environment, we can live with sharing these indexes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment