Use Indexing Strategies

To keep search indexes up to date, Coveo for Sitecore leverages Sitecore index update strategies.

We recommend that you allow the strategies to do the work for you, as much as possible. When a manual update of your search indexes is absolutely necessary, there are several methods you can choose from (see Update Your Search Indexes).

Default Configuration

By default Coveo for Sitecore will create two indexes: Coveo_master_index and Coveo_web_index.

Index ID Strategy element name Item indexed when it’s

Coveo_master_index

coveoSyncMaster

Saved

Coveo_web_index

coveoOnPublishEndAsync

Published

Location of the Strategy Statement

The strategies are defined on each index in the CoveoSearchProvider.config file.

<index id="Coveo_web_index" type="Coveo.SearchProvider.ProviderIndex, Coveo.SearchProvider" patch:before = "*[2]">
  <param desc="p_Name">$(id)</param>
  <configuration ref="coveo/defaultIndexConfiguration" />
  ...
  <strategies hint="list:AddStrategy">
    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/coveoOnPublishEndAsync"/>
  </strategies>
  ...
</index>

Editing a Strategy

  1. Open your Coveo.SearchProvider.Custom.config file. It’s located under <SITECORE_INSTANCE_ROOT>\Website\App_config\Include\Coveo.

  2. At the end of the sitecore node, before the scheduling node, if the index you want to update doesn’t exist yet, create it by adding the following elements:

     <contentSearch>
       <configuration>
         <indexes>
           <index id="Coveo_web_index">
             <strategies hint="list:AddStrategy">
               <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/coveoOnPublishEndAsync"/>
             </strategies>
           </index>
         </indexes>
       </configuration>
     </contentSearch>
  3. Change the index id to the index you want to modify.

  4. Change the strategy to match the one you want to modify.

  5. Save and close your file.