Resetting Search Index in SharePoint 2013:

searchadministration_thumb2

Search is indeed a mission critical service application in SharePoint and it’s very important that it remains healthy so that you get the results in the Search center whenever you execute a search query. However, it’s quite possible that you may notice some errors in the “Crawl log” stating that the crawler is not able to crawl the contents in the content source and at times it might get even worse such that you may notice all “failures” and no “success” in the crawl logs. In scenarios like that you might have to reset the search index so that the content in the index gets flushed away after which you need to perform a full crawl so that search index component receives the newly processed items from the content processing component and writes them to the search index. Of course, directly resetting the index is not a fix for any search related issue, please ensure that you do all the necessary troubleshooting steps from your end to identify and fix the issue and once you reach a point where nothing really helped, that’s when you should think about resetting the search index.

What happens when you reset the Search Index?

When you reset the search index, all the contents will be immediately removed from the search index and users will not be able to retrieve search results when they execute a search query on the search center.  Once you’re done resetting the search index, you must perform a full crawl on one or more content sources to create a new search index. Users will be able to retrieve search results again once the full crawl is finished and the new search index is created. So in a nutshell there will be a downtime when the search index is getting reset. After a search index reset, the full crawl won’t restore all the analytics features that are powered by the Analytics Processing Component. All the analytics results will be erased after resetting the search index.

When we should reset the search index?

As I already mentioned above, resetting the search index should be the final step of troubleshooting for any search related issue. However, based on my experience this when we should reset the search index ….

  1. Index is corrupted
  2. One or all index component status is degraded
  3. You crawl completed successfully but you are not getting the search results.
  4. When you move the index location
  5. When Index location run out of space.
  6. In a scenario where we have Index partitions spread across multiple servers and the indexed document count is out of sync. For example, we have 2 servers set as index partitions, server 1 has 150K indexed documents and server2 has 145k index documents
  7. If we make any changes to search topology such as removing the search components ,adding the components & activating a different search topology

 Alright, now let’s take a look at the steps to reset the search index …

Pre-requisites: 

Please ensure that you take care of the below mentioned pre-requisites before resetting the search index .Failing to do so will cause adverse effects and at worst case you may end up recreating the entire search service application.

  1. Make sure the crawl status for each content source is “Idle”. If any crawl is running, wait for the crawl to complete or follow the steps to “Stop the active crawls” below.
  2. Make sure continuous crawl for content sources is disabled [if applicable].This step is only specific to SharePoint 2013 and above.
  3. Make sure the crawl rate is 0
  4. Make sure background activity status is “None” on search administration page.

Stopping the Active Crawl(s):

  1. Navigate to search administration page.
  2. Click on Content Sources link towards your left hand side as shown in the image below.

4

3. If any content source is crawling, click on the drop down of the content source and click on “Stop Crawl”.

Disable Continuous Crawl:

  1. Navigate to search administration page.
  2. Navigate to Content Sources link appearing on quick launch.

4

3. Click on the drop down and select “Disable Continuous Crawl” to disable it.

5

4. Click “Ok” when below warning message appears.

6

5. Follow the same steps to disable continuous crawl for other content sources. Finally, all the content sources would show “Idle” status as shown in the image below.

7

Suspend Search Service Application:

This step is to ensure that there is no crawling activity in place while we perform the Index reset.

  1. Open SharePoint Management Shell using service account
  2. Run the below command.

Suspend-SPEnterpriseSearchServiceApplication “Search Service Application Name”

Note: If you don’t know the name of search service application, you can get it by running below command before executing the above command.

Get-SPServiceApplication | Where-Object {$_.TypeName –eq “Search Service Application”}

After suspending the search application, search administration page will show the status as “Paused for: External request” as shown in the image below.

8

 Ensure Crawl Rate is 0:

  1. Navigate to search administration page.
  2. Check the Recent Crawl rate.

9

Ensure Crawler Background Activity is none:

  1. Navigate to search administration page.
  2. Check the status of the Crawler background activity and ensure it shows as “none” as shown in the image below.

10

Once the necessary pre-requisites are taken care, please follow the below steps to perform an Index Reset.

There are 2 ways to perform Index reset.

Using UI [User Interface]: This method can be used when the indexed content in your farm is not much in size i.e. index size is not huge and also when you don’t have large content sources.

Using PowerShell: UI method is not recommended for SharePoint farms with large search index. [i.e. huge count of searchable/indexed documents]. Using the UI method in large farms for resetting the search index can result in time out error. In such cases, we need to use PowerShell method to reset the index.

USING UI:

  1. Navigate to SharePoint Central Administration.
  2. Under “Application Management” category, click on “Manage Service Applications”.
  3. Find out “Search Service Application” and click on the Search service application.
  4. In the quick launch, click on “Index Reset

reset-crawl-index-sharepoint-2013

5. Click on confirm once done .

USING POWERSHELL:

  1. Login to the SharePoint server using Administrator credentials.
  2. Open “SharePoint management shell” with elevated permissions.
  3. Run the below command to reset search index.

12

Post Index Reset Steps:

  1. Check whether the number of searchable items is 0.
  2. Resume the search service application by running the command shown in the screenshot below.

133. Enable “continuous crawl” for the content sources if it was enabled prior to index reset.

4. Run full crawl for the content sources one by one.

This confirms that you’re done resetting the Search index successfully and please keep monitoring the full crawl and ensure that it doesn’t get stuck in the middle. The time duration for the full crawl depends on the size of the content source, if you have very large content sources then it might take days for the full crawl to complete successfully. Once done, please verify the search results and ensure that they return fine. Also check the “Crawl log” and make sure you’re not seeing any errors this time.

Thanks for reading this post …..Happy SharePointing!!!

Advertisements

5 thoughts on “Resetting Search Index in SharePoint 2013:

  1. Thank you so much for the fantastic explanation and the step-by-step walk through. Definitely made this so much easier for me to perform this step. I also liked the break-down on *when* you should do this. Thanks again!!

    Like

  2. Hi Vignesh,
    Got another question for you. SP 2013 farm running incremental crawl. Every crawl shows around 50,000 successes in crawl history. I cant see this amount of files being changed between crawls. Everything works fine so am tempted to just leave it as it has been like this since before I joined, and the road map is changing to O365, and to be honest it is not effecting users. But I would like to clean it up if I can. I don’t think it is security changes linked to AD. But cant seem to find out what it is.
    thanks
    Anthony

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s