How to rebuild sitecore search indexes?

You might come upon certain situations where you need to rebuild Sitecore search indexes instantly for ex: when you deploy huge contents into the live production environment if the indexes are out of date, or when the indexes get corrupted.

Below are the three different ways to rebuild Sitecore search indexes.

Rebuild index using Sitecore control panel

  1. Login to Sitecore and open the control panel
  2. Scroll down to the indexing section and click on the link Indexing Manager. An overlay will open with all the local indexes names.
  3. Select the indexes which you need to rebuild, let us say if you would like to re-index the master database then select sitecore_master_index and click on the rebuild button.
  4. This might take some time depending on the number of items on the Sitecore, once the indexing is finished you would be able to search the item.

Rebuild Sitecore Search Index Programatically

Rebuild Sitecore Search Index Programmatically

Sitecore has an API which allows you to rebuild the indexes. You could use this approach to rebuilding the search index whenever items are published to the production environment.

You can rebuild indexes from custom code by running a script similar to one of these from a custom .aspx page:

// To rebuild "new" search indexes, use this piece of code for every "new" index
IndexCustodian.FullRebuild(ContentSearchManager.GetIndex("[INDEX NAME]", true);
// Or to rebuild all indexes, use the following piece of code:
IndexCustodian.RebuildAll();

Rebuild Sitecore Search Indexes Using the Content Editor

To Rebuild Sitecore Indexes from the Content Editor follow the below steps:-

  1. Login to the Sitecore and navigate to 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:
    Build Index In Sticore Using Content Editor
  3. 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.

Sitecore Rebuild Index

  1. Rebuild all – rebuilds all indexes.
  2. 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.
Leave a Reply

Your email address will not be published. Required fields are marked *

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

You May Also Like