question

TanmoyDas-9282 avatar image
0 Votes"
TanmoyDas-9282 asked EchoDu-MSFT commented

Modify search topology in SharePoint 2013

Hi All,

I have 4 web servers as query/index components. I want to remove the query and index role from all of them, there are other servers with query and index roles.

Can this be done using PowerShell?

Is there any risk associated with it?

Do I need to reset the index first and then perform this? I prefer not to reset the index.

office-sharepoint-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

EchoDu-MSFT avatar image
0 Votes"
EchoDu-MSFT answered EchoDu-MSFT commented

Hi anonymous user ,

You needn't reset the search index. But before we can start modifying the search topology, we need to ensure that the Search Index is empty and that no crawls are currently running or scheduled to run during our modifications.

Please following step:

Step 1: Check Index File Location

Run the below PowerShell script as an admin:

 ADD-PSSNAPIN MICROSOFT.SHAREPOINT.POWERSHELL
 $SSI = GET-SPENTERPRISESEARCHSERVICEINSTANCE
 $SSI.COMPONENTS

114922-step1.png


Step 2: Ensure Search Index is Empty and No Crawls are Running

  1. Browse to SharePoint Central Administration >> Application Management >> Manage Service Applications >> Search Service Application

  2. From the Search Service Application: Search Administration page, ensure that the Searchable Items shows “0”
    114854-step2.png

  3. Next, while still on the Search Administration page, select Content Sources from the Crawling section in the quick launch area.

  4. On the Manage Content Sources page, verify that the status shows “Idle” and no crawls are scheduled to run in the near future.
    114780-step2-1.png


Step 3: Modify Search Topology

In my test, I have two Web Front End Servers and two Application servers. I will choose to run the Search components on both Application Servers. If you have more than two servers, the below script can be modified to add additional hosts.

 $HOSTA = GET-SPENTERPRISESEARCHSERVICEINSTANCE -IDENTITY "SERVER1"
 $HOSTB = GET-SPENTERPRISESEARCHSERVICEINSTANCE -IDENTITY "SERVER2"
 START-SPENTERPRISESEARCHSERVICEINSTANCE -IDENTITY $HOSTA
 START-SPENTERPRISESEARCHSERVICEINSTANCE -IDENTITY $HOSTB

Wait until all the search service instances are running. At the Windows PowerShell command prompt, type the following commands until the commands return the state "Online" for each of the search service instances:

 GET-SPENTERPRISESEARCHSERVICEINSTANCE -IDENTITY $HOSTA
 GET-SPENTERPRISESEARCHSERVICEINSTANCE -IDENTITY $HOSTB

You will now need to create an entirely new Search Topology. Using PowerShell ISE, type and run the following commands:

 $SSA = GET-SPENTERPRISESEARCHSERVICEAPPLICATION
 $NEWTOPOLOGY = NEW-SPENTERPRISESEARCHTOPOLOGY -SEARCHAPPLICATION $SSA

Now it is time to choose which search components you want to run on what servers. In this example, as I only have two application servers, I am going to split each component and have each server run all components. As you can see in the following commands, each server will host the same six components.

 NEW-SPENTERPRISESEARCHADMINCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTA
 NEW-SPENTERPRISESEARCHCRAWLCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTA
 NEW-SPENTERPRISESEARCHCONTENTPROCESSINGCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTA
 NEW-SPENTERPRISESEARCHANALYTICSPROCESSINGCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTA
 NEW-SPENTERPRISESEARCHQUERYPROCESSINGCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTA
 NEW-SPENTERPRISESEARCHINDEXCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTA -INDEXPARTITION 0
 NEW-SPENTERPRISESEARCHADMINCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTB
 NEW-SPENTERPRISESEARCHCRAWLCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTB
 NEW-SPENTERPRISESEARCHCONTENTPROCESSINGCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTB
 NEW-SPENTERPRISESEARCHANALYTICSPROCESSINGCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTB
 NEW-SPENTERPRISESEARCHQUERYPROCESSINGCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTB
 NEW-SPENTERPRISESEARCHINDEXCOMPONENT -SEARCHTOPOLOGY $NEWTOPOLOGY -SEARCHSERVICEINSTANCE $HOSTB -INDEXPARTITION 0

Now activate the new search topology. Run the following command to active the topology. (PS: This command could take a few minutes to run)

 SET-SPENTERPRISESEARCHTOPOLOGY -IDENTITY $NEWTOPOLOGY

Verify that the new search topology is active:

 GET-SPENTERPRISESEARCHTOPOLOGY -SEARCHAPPLICATION $SSA

The following command can be used to verify each component of the search topology.

  • GET-SPENTERPRISESEARCHSTATUS -SEARCHAPPLICATION $SSA -TEXT

Reference:

Thanks,
Echo Du
======================================
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





step1.png (49.6 KiB)
step2.png (31.7 KiB)
step2-1.png (38.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How I can make the search index empty without an index reset? I am not sure about that

0 Votes 0 ·

HI anonymous user ,

Yes, you need reset the search index and do not perform a full crawl.

Thanks,
Echo Du

0 Votes 0 ·