Thursday, March 12, 2015

How to: (Unexpectedly) Block the usage of the list/library search box in SharePoint

image

SharePoint has a nifty search box above a list or library which can be used to quickly filter items for that library. So how do you make sure it doesn’t work?

Well…. for some reason you might have decided to change the default Result Source for the web or site collection. The why is most likely related to convenience where you have perhaps chosen to include content by some business requirement. All items tagged as “Public” for example with the query template: {searchTerms} category:”Public”

image

If you now try to search in your list/library you will only get hits if the list has a column named category and items are set to be Public.
And..boom.. your smartness with a new default Result Source has killed local list/library search.

image

Lessons learned:
  • Leave Local SharePoint Results as the default source – makes your life easier
  • If you want a different result source on your search site or via API, specify the result source explicitly – makes your life easier