Sometimes you just need to rebuild SharePoint 2010 search. It happens. Life happens. SharePoint 2010 Search poops the bed. This article will discuss how to remove a SharePoint 2010 search service application and clean up leftover search components.
So the first thing we need to do is remove the search service application. This can be done using Central Administration or PowerShell.
To remove the search service application using Central Administration:
To remove the search service application using PowerShell:
1 2 |
$ssa = Get-SPServiceApplication -Name "Your Search Service Application Name" Remove-SPServiceApplication $ssa - RemoveData |
Sometimes neither of the above methods work and result in timeout and/or error(s). In this case, the following PowerShell can be used as a final resort:
1 2 3 4 5 6 7 8 9 10 11 |
# Method One Get-SPEnterpriseSearchServiceApplication # Take note of the search service application GUID $ssa = Get-SPEnterpriseSearchServiceApplication -id "<search_guid>" $ssa.unprovision(1) # Method Two - In Case Method One Fails Get-SPEnterpriseSearchServiceApplication # Take note of the search service application GUID $ssa = Get-SPEnterpriseSearchServiceApplication -id "<search_guid>" $ssa.delete() |
Once the search service application has been removed, there may be leftover components running the search server(s).
To ensure this service has stopped on all farm servers:
1 |
Get-SPEnterpriseSearchServiceInstance -Local | Stop-SPEnterpriseSearchServiceInstance |
1 |
Get-SPEnterpriseSearchServiceInstance | Stop-SPEnterpriseSearchServiceInstance |
To ensure this service has stopped on all farm servers:
To ensure this service has stopped on all farm servers:
1 2 3 |
$srv = Get-SPServer -Identity <SEARCH_ADMIN_SERVER> $si = $srv.ServiceInstances | Where {$_.TypeName -eq "Search Administration Web Service"} Stop-SPServiceInstance $si |