Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
.Clone() or -Clone, that is the question... - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2014-03-10

When you are working with Search in SharePoint 2013 you no longer have the luxury of using the GUI to modify search topology. Now we have to directly modify a topology using a clone in PowerShell.
At a high level we have the:

  • Search Service Application
  • Search Topology
  • Search Instance on each Server in the search topology

We also have the following components:

  • Admin
  • Crawler
  • Content Processing
  • Analytics Processing
  • Query Processing
  • Index

When we want to change the topology of a search service application such as:

  • Change the index location on the index component
  • Add a index replica on another server in the farm
  • Add additional components to other servers in the farm
  • Remove components

We have to first clone the active topology, make our changes to the clone and then activate the clone. However, there is a difference between using the Clone() method on the SSA and using the
New-SPEnterpriseSearchToplogy –Clone switch. One gives your newly cloned components IDs where the other does not.
When we create a clone by doing the following

$ssa = get-spenterprisesearchserviceapplication
$clone = $ssa.ActiveTopology.Clone()

We get this when we look at the topology:

image

And we get this when we look at the components in the cloned topology: (Get-SPEnterpriseSearchComponent  -SearchTopology $clone)

image

As you can see above, all of our components have blank IDs. If we wanted to remove a component from the topology how would we identify which component to remove? The Remove-SPEnterpriseSearchComponent -Identity switch wants an ID of the component to remove so we need to get a valid ID in order for this work.
Using the above method we can easily add additional components to the topology but we cannot remove.

Solution

After you capture your SSA run the following command:

$active = Get-SPEnterpriseSearchTopology -Active -SearchApplication $ssa
$Clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active

Now we get this: 

image

Now we have an ID field that we can use to easily remove a component from the topology.

{Kam]

(Visited 95 times, 1 visits today)

About the author 

Kameron Berget

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.