Monday 7 August 2017

SharePoint 2013 Search - Remove an index component

Make sure that the current active topology is healthy and that the search component that you are about to remove is Active.

Note: If you have more than one active index replica for an index partition, you can remove an index replica by performing the procedure Remove a search component in the article Manage search components in SharePoint Server 2013.

You cannot remove the last index replica of an index partition using this procedure. If you have to remove all index replicas from the search topology, you must remove and re-create the Search service application and create a completely new search topology that has the reduced number of index partitions.

Step #1: Get the Search Service Instance and Start
$ssi4 = Get-SPEnterpriseSearchServiceInstance -Identity "CA1VMSPUATAPP04"

Step #2: Wait for the Search Service to Come Online
Start-SPEnterpriseSearchServiceInstance -Identity $ssi4

Step #3: Clone the Active Search Topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone SearchTopology $active

#To see which components you have, use the following command.
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

Step #4: Get the ID of the Index Component to Remove
$indexComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity IndexComponent3).componentID

Step #5: Remove the original Index Component
Remove-SPEnterpriseSearchComponent -Identity $indexComponentID.GUID -SearchTopology $clone -confirm:$false

#Repeat step #4 and #5 for any additional servers you want to remove the index or any other component(like Admin,Query,Contentprocessing..etc) for.

Step #6: Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone

Step #7: Monitor the Distribution of the Index 
Get-SPEnterpriseSearchStatus -SearchApplication $ssa

No comments:

Post a Comment