Remove a SharePoint On-Prem Search Component

You may want to remove a search component because it is corrupt or you want to free up resources. You can do this by following these steps.

1. Open up “SharePoint 2013 Management Shell” on one of the SharePoint servers as an administrator.
2. Type in the following commands replacing with the name of the server where you are placing the Analytics Processing Component.

$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa –Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa –Clone –SearchTopology $active
3. Use the following command to locate the “Component ID” of the component you want to remove

Get-SPEnterpriseSearchComponent -SearchTopology $clone

4. Copy the “Component ID” (a GUID) and replace in the following command with the ID of the component you want to remove.

Remove-SPEnterpriseSearchComponent -Identity -SearchTopology $clone -confirm:$false

5. Finally, run the following command (you can run multiple Remove commands before you do this one) to remove the component(s).

Set-SPEnterpriseSearchTopology -Identity $clone

Verify your results in Central Admin to make sure the component is truly removed. This might take several minutes.