Modify Search Box in Sharepoint 2013

Hi all,

Today I will post about the how to modidy the behaviour of the search box in Sharepoint 2013.

Firstly, I will write something about how it works, when a search is executed in the search box web part, it starts looking for the settings at 1st level, then goes to 2nd level and so on until it finds a configuration. When it finds a configuration, it will not look at the next levels. Because of this, you can overwrite the search box settings at any level.

The search box results address Url can be set at the following levels:

  • SharedSearchBoxSettings: from ResultsPageAddress property
  • Web: from web property “SRCH_ENH_FTR_URL_WEB”
  • Site collection: from root web property “SRCH_ENH_FTR_URL_SITE”
  • Search Service Application: from Search Center Url property

A simple configuration scenario would be to set up a search center for all sites & site-collections in the farm, and to disable the search drop down scopes. In this scenario, you would also have a centralized place for your search settings.. You only need to set the search box settings at the Service Application level, and leave all sites/site-collections to inherit this configuration:


$ssa = Get-SPEnterpriseSearchServiceApplication
#replace {SearchCenterUrl} with the Url of your search center
#settings ShowNavigation to false will not display the search scopes anymore.
$ssa.SharedSearchBoxSettings = "{'Inherit':false,'ResultsPageAddress':'http://appweb/searchcenter/results.aspx','ShowNavigation':false}"
$ssa.Update()

Hope it helps!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s