Sunday, August 25, 2013

Creating or Modifying Search Topology in SharePoint 2013

The Search service application introduced in SharePoint 2013 is different than that of SharePoint 2010 in more ways than just one.

To start with, SharePoint 2013 uses the web-based interface to change the current status of the topology. It can only be done by using Windows PowerShell. SharePoint Server 2010 also included a web-based option for changing the topology.

The Search Query web service is deprecated in SharePoint 2013. Search in SharePoint 2013 supports FAST Query Language (FQL) syntax and Keyword Query Language (KQL) syntax for custom search solutions. You cannot use SQL syntax in custom search solutions - FullTextSQLQuery was used for this purpose in SharePoint 2010. In SharePoint 2013, this class has been deprecated. It doesn't even support backward compatibility.

Custom search solutions that use SQL syntax with the Query object model and the Query web service that were created in earlier versions of SharePoint Server do not work when you upgrade them to SharePoint 2013. If you submit queries by using these applications, you will receive an error.

There are a lot more features which have been deprecated in SP 2013, thorough details of which you can find here.

The information I am going to share with you will help you configure your search service application to get it up and running for your sites. We will start with changing the default search topology and then move on the Search Service application configuration which I would cover in a different post. Please note that creating a new search topology is not a mandate if the Search is configured properly on your server.

Creating a Search Topology / Changing the Default Search Topology

For demonstrative purposes and making things easy to understand, I'll consider a farm consisting of only server. For multi-server approach, you may refer this link.

- Ensure that no crawls have been started and that the search index is empty on the server that hosts Central Administration.

- Verify that the user account that is performing this procedure is an administrator for the Search service application.

- In Central Administration, in the Application Management section, click Manage Service Applications.

- On the Manage Service Applications page, in the list of service applications, click the Search service application.

- Verify that the search index is empty. On the Search Administration page, under System Status, verify that Searchable items displays "0". Here, if the Searchable items are not zero, discontinue this process and make sure you click on 'Reset Search Index'. Only then move on with the next steps.

- Verify that no crawls have been started. On the Search Administration page, under Crawling, click Content Sources. On the Manage Content Sources page, verify that the Status column for any existing content source displays Idle.

- Start a SharePoint 2013 Management Shell on one of the servers in the farm.

- Specify the new servers you want to add search components to, start a search service instance (ssi) on these servers and create references to the search service instances. In this procedure we have used the example host name "server_name" for the server. At the Windows PowerShell command prompt, type the following command(s):

$host = Get-SPEnterpriseSearchServiceInstance -Identity "server_name"
Start-SPEnterpriseSearchServiceInstance -Identity $host

- 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 the search service instance:

Get-SPEnterpriseSearchServiceInstance -Identity $host

- Create a new search topology and a reference to the new search topology. At the Windows PowerShell command prompt, type the following command(s):

$ssa = Get-SPEnterpriseSearchServiceApplication 
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa

- Add all the search components to the new search topology. The following Windows PowerShell commands will create the search components of the new topology and assign them to the new server.
In this small enterprise search topology there is one index partition, index partition 0, to cater for a maximum of ten million items. This is indicated with the parameter -IndexPartition in the command New-SPEnterpriseSearchIndexComponent. 

At the Windows PowerShell command prompt, type the following command(s):

New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $host

New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $host

New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $host

New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $host

New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $host

New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $host -IndexPartition 0

 - Activate the new search topology. At the Windows PowerShell command prompt, type the following command:

Set-SPEnterpriseSearchTopology -Identity $newTopology

 - Verify that the new search topology is active. At the Windows PowerShell command prompt, type the following command:

Get-SPEnterpriseSearchTopology -SearchApplication $ssa

The command returns an overview of active and inactive topologies, in this example:

TopologyId     : 6E680C1A-14F3-4280-8524-CDBC52E0AEF2
CreationDate   : 8/24/2013 7:45:00 AM
State          : Active
ComponentCount : 6

The new active topology from this example will have a component count of six.

 - Verify that all components of the new search topology are running correctly. At the Windows PowerShell command prompt, type the following command:

Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text

This command should return a list of all the active search components. The state of the active search components should be displayed as Active.

Voila ! Your topology is now ready for use :)

No comments:

Post a Comment