Subscribe via RSS Feed Connect with me on LinkedIn

Creating a New Search Topology in SharePoint 2013

[ 0 ] June 8, 2013 |

Back in SharePoint 2010, we were able to modify the search topology of our farm directly in Central Admin. This has been changed in SharePoint 2013 and we now have to make these types of changes via PowerShell.

Not a big deal, however, a couple things to note:

  1. You can either clone an existing topology, or:
  2. You can create a brand new one.

This is an important differentiator, because several of the examples on the web will use those two interchangeably, but they each have a different effect when run.

Cloning a topology makes sense when you have items in your index, and you want to move components around.

Creating a brand new topology requires that you have a blank index.

Kathryn wrote up a good summary on this: http://blog.sharepointsalvation.com/?p=71 as well as Ravikanth: http://www.powershellmagazine.com/2013/04/29/creating-and-configuring-a-sharepoint-2013-search-service-application/

The following is my version of the above, with some minor tweaks:

$app1 = "appserver1"
$app2 = "appserver2"
 
$newTop = New-SPEnterpriseSearchTopology -SearchApplication $ssa
 
$App1SSI = Get-SPEnterpriseSearchServiceInstance -Identity $app1
$App2SSI = Get-SPEnterpriseSearchServiceInstance -Identity $app2
 
New-SPEnterpriseSearchAdminComponent –SearchTopology $newTop -SearchServiceInstance $App1SSI
 
New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $newTop -SearchServiceInstance $App1SSI
New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $newTop -SearchServiceInstance $App2SSI
 
New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $newTop -SearchServiceInstance $App1SSI
New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $newTop -SearchServiceInstance $App2SSI
 
New-SPEnterpriseSearchCrawlComponent –SearchTopology $newTop -SearchServiceInstance $App1SSI
New-SPEnterpriseSearchCrawlComponent –SearchTopology $newTop -SearchServiceInstance $App2SSI
 
New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $newTop -SearchServiceInstance $App1SSI
New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $newTop -SearchServiceInstance $App2SSI
 
$PrimaryIndexLocation = "C:Data"
 
New-SPEnterpriseSearchIndexComponent –SearchTopology $newTop -SearchServiceInstance $App1SSI -RootDirectory $PrimaryIndexLocation -IndexPartition 0
New-SPEnterpriseSearchIndexComponent –SearchTopology $newTop -SearchServiceInstance $App2SSI -RootDirectory $PrimaryIndexLocation -IndexPartition 1
 
$clone.Activate()
 
$ssa = Get-SPEnterpriseSearchServiceApplication
Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa

The only thing I would want to add, is if you’re like me and you make a few mistakes before getting it run, run the following command to purge inactivate topologies:

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

Tags: , , ,

Category: SharePoint 2013

About Shereen Qumsieh: View author profile.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.