Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinrayenglish/0ae050ae007f985ee9a79c9c0d67fd71 to your computer and use it in GitHub Desktop.
Save martinrayenglish/0ae050ae007f985ee9a79c9c0d67fd71 to your computer and use it in GitHub Desktop.
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