---
title: "Rebuild search indexes"
slug: "rebuild-search-indexes"
abstract: "Describes how you rebuild search indexes in different ways."
---
# Rebuild search indexes

There are situations where you need to rebuild indexes, for example, when you deploy to a production environment, when indexes are out of date, to remove obsolete documents from a search index, or when indexes have been corrupted.

> [!note]
> The 'Re-Index Tree' operation, also known as the Refresh operation, updates the search index based on the items that are still present in a Sitecore database. This operation does not delete any obsolete documents from a search index.

There are three different ways to rebuild indexes. This topic describes how to:

- Use the Control Panel
- Use custom code
- Use the Content Editor
- Use the CLI

## Use the Control Panel

To rebuild indexes from the Sitecore Control Panel:

1. Log in to SitecoreAI and, on the Dashboard, on the **Tools** tab, click **Control Panel**.
2. In the **Indexing section,** click **Indexing Manager**.
3. In the **Indexing Manager** dialog box, select the indexes you want to rebuild, and click **Rebuild**:

    ![2BFB1AB2D43649DBB5C59AFFBB828217.png](https://doc.sitecore.com/api/markdown-image/sai/en/developers/sitecoreai/images/2BFB1AB2D43649DBB5C59AFFBB828217.png)

> [!note]
> Indexing progress can be seen through the **Indexing Manager** dialog. If you close the **Indexing Manager** dialog while an index rebuild is in progress, you can continue to monitor the rebuild on the `/sitecore/admin/jobs.aspx` page. 

## Use the Content Editor

To rebuild indexes from the Content Editor:

1. In the Content Editor, click the **Developer** tab.

    > [!note]
    > If you do not see the Developer tab, right-click in the menu bar and select Developer in the list of tabs.

2. In the **Indexing tools** group, select one of the options to rebuild indexes:

    ![1135B036372D4A8681787EEB7032F762.png](https://doc.sitecore.com/api/markdown-image/sai/en/developers/sitecoreai/images/1135B036372D4A8681787EEB7032F762.png)

    - **Rebuild index –** opens a list of all indexes. This list contains information about when each index was last rebuilt. Select an index to rebuild it.
    - **Rebuild all –** rebuilds all indexes.
    - **Re-Index Tree –** process the selected item and all descendants recursively, and force an update operation on all indexes that are related to the selected content area.

        > [!note]
        > Use this command only in situations where incremental indexing is either not working as expected, or when you use the manual update strategy. You should only do this when absolutely necessary.

## Use the Sitecore CLI

You can use the [indexing plugin](https://doc.sitecore.com/sai/en/developers/sitecoreai/sitecore-command-line-interface/plugins/indexing-plugin.html "Indexing plugin") that is available for the [Sitecore CLI](https://doc.sitecore.com/sai/en/developers/sitecoreai/sitecore-command-line-interface.html "Sitecore Command Line Interface") to rebuild indexes.

To rebuild indexes using the Sitecore CLI:

- Run the `sitecore index rebuild` command in a terminal.

> [!note]
> For more information, see [The CLI index command](https://doc.sitecore.com/sai/en/developers/sitecoreai/sitecore-command-line-interface/sitecore-cli-command-reference/the-cli-index-command.html "The CLI index command").