Locking Down Search for a Site (Part 2 – SP2013, SP2016, SP2019)

If you want to achieve the functionality I outlined in “Part 1” using SharePoint 2013 UI, or higher (SP 2016, 2019), you are going to need to go through a different process, as Microsoft deprecated Search Scopes in the 2013 UI.  Fortunately, the work around is actually a bit less work, as you only need to modify your search results page.

The first step is to create a new results page.  This can be done by navigating to the “Pages” area of your search site. (ie. click the gear icon, and then “Site Contents”).  From there, click the Documents drop down, and choose a new “Welcome Page”.

It should default to a “Search Results” page template, but if it does not, be sure you choose that type.  Give it a title relating to the search you want to have the page limited to.

Once you have the page created, click “Edit” from the toolbar, and scroll down to the search results area.  Choose “Edit Web Part” from the Search Results web part.

From there, click the “Change Query” button from the web part editor’s “Properties for Search Results” section.

Here is where you are going to restrict the results for the page. Under the “Basics” tab, you will have several property filters to choose from.  If you do not see the one you want, you can load all the properties by clicking the “Show all managed properties” option at the bottom.  For this example, I want to restrict the results to a particular site, so I chose the “Site” property, and then filled in the URL for the site.  You can use the “Test Query” button to confirm there are results coming through, provided your site already has some content.

Click OK to save the updated settings.

 

Next you will likely want to do some tidying up, and possibly even include a new tab for your new search results page.

Choose “Edit Web Part” for the Search Box further up at the top of the page, and click the checkbox for “Use this site’s Search Settings”.

Also click the link where it is hyperlinked to “Search Settings”.  This is where you can add a new tab to the search navigation for the page.  Give it a title, and then put in the link to the custom results page you just created.   Click OK for the Search Settings, and also OK for the Search Box settings.

Save and publish the page.  Run a few queries to make sure you didn’t miss anything.

That’s it! You are done.

You can also reference search boxes on your other sites to use this custom results page.  Just point them there.

 

Posted in SharePoint 2013, SharePoint 2016, SharePoint 2019 and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *