Update Your Search Indexes

This article explains how to rebuild a search index in Sitecore. For an overview of the indexing process, see the Coveo for Sitecore Indexing Guide.

Rebuilding a Search Index Manually

This method re-indexes all the items of the content tree for the Sitecore databases that you select. Every single item is re-indexed, regardless of whether it was changed, so this operation can be time-consuming.

Use this method when:

  • You have just installed Coveo for Sitecore, as your search indexes are empty at this point.

  • You need to re-process all items of your content tree. This could be the case if you configured a Computed Field or an Inbound Filter.

To re-index your entire Sitecore content tree

  1. Navigate to the Indexes section of the Command Center at https://<INSTANCE_HOSTNAME>/coveo/command-center/index.html#indexes/.

  2. Rebuild the Coveo indexes for both Sitecore databases or only one of the two indexes.

    • To rebuild both the Coveo_master_index and the Coveo_web_index

      Click Rebuild All near the upper-right corner of the screen.

      Screenshot of the Coveo Command Center showing index statuses and document counts
    • To rebuild only one of the two Coveo indexes

      1. Click the Coveo_master_index or the Coveo_web_index row to expand its index details section.

        Screenshot of the Command Center indexes page with the Coveo Web Index expanded
      2. Click Rebuild near the bottom-left of the page.

  3. Follow the rebuild progress.

    Screenshot of the Command Center indexes page with both indexes in the Documents Validation phase and the Sending Permissions phase displayed as skipped because index permissions is set to false
  4. An index is done rebuilding when its status returns to Idle.

    Screenshot of the Command Center with both indexes now showing status Idle and a message saying their last rebuild completed some minutes ago
    Tip
    • You can hover your mouse over the index progress bar for details regarding each indexing phase. For example, you can hover over a skipped phase for an explanation in this regard.

      Screenshot showing the user hovering their mouse over the Sending Permissions phase in the indexing progress bar and Coveo providing a tooltip message explaning why the phase was skipped
    • An index rebuild is failing or taking longer than normal? Analyze the rebuild logs to isolate the issue.

Refreshing a Crawler

A Crawler refresh re-indexes only the crawler Root item and all its sub-items. Additionally, a refresh doesn’t include a DocumentsValidation step, as does a rebuild operation. A refresh is therefore significantly less resource-intensive than a rebuild.

You can access the crawler Refresh buttons in the Indexes section of the Command Center by expanding the index row.

Screenshot of Coveo Command Center indexes page with the Coveo web index expanded revealing the refresh buttons

Coveo for Sitecore default crawler configurations are defined in the Coveo.SearchProvider.config file and you can patch these configurations in Coveo.SearchProvider.Custom.config (see Change the Crawling Root of an Index).

Re-Indexing a Section of Your Content Tree in the Content Editor

This method will re-index only one item of your Content Tree, and its descendants. Only modified items will be re-indexed, so this method is quite fast.

Use this method when you only need to re-index a section of your Content Tree. This is especially useful for development and testing/debugging purposes.

Steps

  1. Log in to the Sitecore Desktop.

  2. In the lower-right corner, select the database for which you want to re-index an item. By default, the master database is selected.

    Screenshot of the lower-right corner of the Sitecore Desktop showing the selected database
  3. Open the Content Editor (Sitecore Start Menu > Content Editor).

  4. In the left-hand side panel (Content Tree), select the item that you want to re-index.

    Screenshot of the Sitecore content tree with the Home item selected
  5. Under the Developer tab, choose Re-Index Tree.

    Screenshot of the Sitecore Developer tab indexing tools with the Re-Index Tree option highlighted
    Note

    To display the Developer tab, right-click the menu toolbar and select Developer.

  6. Wait for the following dialog to complete.

    Screenshot of the Sitecore Re-indexing the current item and its descendants dialog

Rebuilding a Search Index Programmatically

Important

Refreshing or rebuilding indexes can be resource-intensive for a Sitecore instance. Before building an automation method, ensure that you fully understand the Coveo for Sitecore indexing strategies.

Coveo for Sitecore offers a RESTful indexing API which can be used to rebuild indexes. You can try it on the SWAGGER endpoint by navigating to http://<INSTANCE_HOSTNAME>/coveo/api/index/docs/index#!/Indexes/IndexesV1_Rebuild.