How do I reindex a site or a library in SharePoint

Content in SharePoint needs to be reindexed whenever changes have been done to SharePoint’s search schema and these created or updated managed properties are used in MetaShare, as filters or columns in any of MetaShare’s start pages. In some cases you also might need to reindex a site’s or a library’s content if search does not seem to work in the site/library.

When you reindex a site/library, all items in the site/library will be flagged for recrawl, and during the next incremental or continuous crawl, the items will be recrawled.

A prerequisite to reindex a site/library is that you have the “Manage site” permission, a permission that the site collection administrator of a site has.

How to reindex a SharePoint library

  1. Open the workspace’s SharePoint site.
  2. Open the document library’s settings by clicking on “Site contents” on the left navigation, then clicking on the ellipsis (three vertical dots) and selecting the “Settings” option:
    Open the document library's settings
  3. Under the “General Settings” section, click on the “Advanced settings” link:
    Link to a library's advanced settings
  4. Half way down the page, click on the “Reindex Document Library” button:
    Button for reindexing a library
  5. You will now have to confirm that you want to reindex the library by clicking on the “Reindex Document Library” button:
    Reindex library confirmation
  6. You can now close the page. The library is flagged for reindexing and the library’s content will start to appear in search results when the next search crawl starts, normally within 15 minutes.

How to reindex a SharePoint site

  1. Open the workspace.
  2. Open the workspace in SharePoint.
  3. Click on the “SharePoint Settings” icon and select the ”Site information” option:
    Menu under site settings
  4. On the next page, click on “View all site settings”:
    Link to view all site settings
  5. Under the “Search” section, click on the “Search and offline availability” link:
    Link to Search and offline availability
  6. On the “Search and Offline Availability” page, click on the “Reindex site” button:
    Button that reindexes a SharePoint site
  7. You will now have to confirm that you want to reindex the site by clicking on the “Reindex site” button:
    Reindex site confirmation
  8. You can now close the page. The site is flagged for reindexing and the site’s content will start to appear in search results when the next search crawl starts, normally within 15 minutes.

How to reindex all SharePoint sites

You can reindex all SharePoint sites by using this PowerShell Script. These are the prerequisites to run the script:

  1. The user that runs the script needs to be a SharePoint administrator.
  2. PnP-Powershell needs to be installed on the computer where the script is executed.
  3. If “PnP Management Shell” has not been used before, you also need to give it admin consent.

If the user that runs the script has adequate permissions on a site level to request a reindex, then the action will be executed with the existing permissions, else the user will first temporarily be added as an admin on the site and after the site has been requested to be reindexed, the user’s admin-permission on the site will be revoked.

Information on how to run the script is available in the readme-file.