Monday, October 28, 2013

SharePoint 2013: Cleaning Up Inactive Search Topologies

I woke up Saturday morning with a text message from a SharePoint friend:

"Hey, if u have 2 search topologies, one active and one inactive, can you delete the inactive one?"

I was thinking that this was only in memory since you create clones of the current search topology and then activate it after making appropriate changes. Nope. Every time you update the search topology, the previous one becomes inactive and sticks around in the search database.

You can view your inactive topologies using the following PowerShell command line:

Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$_.State -eq "Inactive"}


With all of my scale-out activities, I had 33 inactive search topologies - doh!

Expanding upon the previous PowerShell command line, you can easily remove all of these:

Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchTopology |? {$_.State -eq "Inactive"} |% { Remove-SPEnterpriseSearchTopology -Identity $_ -Confirm:$false};

You may run the first command line again to verify there are no more inactive search topologies.

Thanks to Chris Rumel for posting this quick PowerShell code here.



Matched Content