SharePoint Search is a great solution that can be used for indexing all kinds of content whether within SharePoint or external such as shared network drives. As SharePoint grows with content, it become important to monitor and check the search configuration to ensure it can handle everything.

Firstly a simple look at the SharePoint Search Service Application can often be enough, to check for errors or just to look at the core topology.

 

As you may know there isn’t really anything else that Central Administration can do for you here, if you wish to delve a little deeper. This has to be done using PowerShell, which has many commands that can be used for this.

To check the search details we can use can start at the highest level and run the “Get-SPEnterpriseSearchServiceApplication” command. This command allows you to see core details of the core Search Service Application.

This is a great starting point to see more detailed information than the standard topology page. Once we have the Service Application we can then start to delve deeper into the configuration and components. Before we do this the best quick view is to utilize the “Get-SPEnterpriseSearchStatus” command. Of course if you have more than one Search Service Application you would specific which one you wanted to use. For me I only have one in this environment so I do not need to pass anything.

$ssa = Get-SPEnterpriseSearchServiceApplication

Get-SPEnterpriseSearchStatus –SearchApplication $ssa

This will outline what components are active or not.

Now we know that the components are active we can use other parameters with the same command to get even more information. Using the following command, we are able to get the default Search Service Application, then run a health report or the Index Component.

Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchStatus -HealthReport –Component IndexComponent1 –Text

We could also run the command for each component in the farm, by changing the “-component” option.

Get-SPEnterpriseSearchStatus -HealthReport –Component IndexComponent1 –Text

Get-SPEnterpriseSearchStatus -HealthReport –Component AdminComponent1 –Text

Get-SPEnterpriseSearchStatus -HealthReport –Component CrawlComponent0 –Text

Get-SPEnterpriseSearchStatus -HealthReport –Component QueryProcessingComponent1 –Text

Get-SPEnterpriseSearchStatus -HealthReport –Component ContentProcessingComponent1 –Text

Get-SPEnterpriseSearchStatus -HealthReport –Component AnalyticsProcessingComponent1 –Text

If we wanted an overall status on the core jobs that SharePoint Search users, then changing the syntax to this will display the main jobs.

Get-SPEnterpriseSearchStatus –JobStatus –Text

Though these commands are useful they are not the best ones for really understanding the core topology. This is done by using the “Get-SPEnterpriseSearchTopology” command which will retrieve the core structure of the current search components.

$ssa = Get-SPEnterpriseSearchServiceApplication

Get-SPEnterpriseSearchTopology -SearchApplication $ssa 

This will display the number of components, but not the broken out details. To see the core component breakdown, we would run the “Get-SPEnterpriseSearchComponent” command.

                              $ssa = Get-SPEnterpriseSearchServiceApplication
                              $topology = Get-SPEnterpriseSearchTopology -SearchApplication $ssa
                              Get-SPEnterpriseSearchComponent -SearchTopology $topology -SearchApplication $ssa

These commands are the start of the ones that we would use to clone an existing Search Topology, modify it, then re-apply it to the SharePoint Farm. SharePoint also contains the command for retrieving the search instances.

                              ​Get-SPEnterpriseSearchServiceInstance -Local                              

Combined with the ability to see the instances we can also check and see where the search Host Controllers are running.

$ssi = Get-SPEnterpriseSearchServiceInstance -Local

Get-SPEnterpriseSearchHostController -SearchServiceInstance $ssi

As you can see there are a ton of commands that you can run to help in auditing your SharePoint Search topology. The following link contains all of the core PowerShell commands for SharePoint Search: https://technet.microsoft.com/en-us/library/ee906563.aspx

Outside of running multiple commands and collating all the results, Microsoft recently released a tool for auditing Search called “Search Health Reports”.

https://blogs.msdn.microsoft.com/sharepoint_strategery/2016/02/01/announcing-the-search-health-reports-srx-for-sharepoint-search-diagnostics/

To utilize this tool, simply download the file and run the initial setup script “initSRx.ps1”. Once it is complete you should see the following message.

Now we are able to run tests to ensure that it is working as expected.

New-SRxReport -RunAllTests

This is a great tool for quickly seeing how well your SharePoint Search is running and working. Combining the core PowerShell commands with this great tool from Microsoft will help you to really evaluate your SharePoint Search Configuration and Setup.