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. Use the following example to enable the Indexing sub-role for the default search indexes:
      <?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>
      
      Custom indexes should be updated in a similar manner.
    2. Select the Sitecore XP instance that should perform index updates. Add the Indexing sub-role in the Web.config file of this instance, e.g.
      <add key="role:define" value="ContentManagement, Indexing"/>

Applies to:

CMS 9.0+

September 03, 2019
May 09, 2020

Keywords: 

  • Search and Indexing