Enable the Indexing role for Azure Search indexes

  • Sitecore search indexes are automatically updated when a content change happens. This is controlled using index update strategies. Solr and Azure Search providers allow sharing of search indexes between Sitecore XP instances. In this case, it is sufficient to have one Sitecore XP instance that performs indexing. Sitecore Roles allows you to disable index update strategies on the instances that do not have the Indexing role.

    1. Create the Sitecore.ContentSearch.Azure.IndexingRole.config file in the \App_Config\Include\zzz folder. The following is an example of the config file:
      <?xml version="1.0" encoding="utf-8" ?>
      <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 search:require="Azure">
          <contentSearch>
            <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
              <indexes hint="list:AddIndex">
                <index id="sitecore_core_index" role:require="Standalone or ContentManagement">
                  <strategies>
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/intervalAsyncCore">
                      <patch:delete />
                    </strategy>
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" 
      role:require="ContentManagement and !Indexing" />
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/intervalAsyncCore" 
      role:require="Standalone or (ContentManagement and Indexing)" />
                  </strategies>
                </index>
                <index id="sitecore_web_index" role:require="Standalone or ContentDelivery or ContentManagement">
                  <strategies>
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncSingleInstance">
                      <patch:delete />
                    </strategy>
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual"
      role:require="(ContentManagement and !Indexing) or (ContentDelivery and !Indexing)"/>
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncSingleInstance" 
      role:require="Standalone or (ContentManagement and Indexing) or (ContentDelivery and Indexing)" />
                  </strategies>
                </index>
                <index id="sitecore_master_index" role:require="Standalone or ContentManagement">
                  <strategies>
                    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster">
                      <patch:delete />
                    </strategy>
                    <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>
                </index>
              </indexes>
            </configuration>
          </contentSearch>
        </sitecore>
      </configuration>
      
    2. Select the Sitecore XP instance that should perform index updates. Add the Indexing role in the Web.config file of this instance.

Applies to:

CMS 9.2 Initial Release+

September 03, 2019
September 03, 2019