1

I have several web application in SharePoint 2016. Now if any site collection admin add search result web part, by default is show result from other web application as well.

I want to change the search setting to be limited to current site collection only. How can I achieve it !

1 Answer 1

1
  • Edit Search Results Page
  • Edit the Search Results Web Part.
  • In the Web Part tool pane, in the Search Criteria section, click Change query.
  • On the BASICS tab > At Query Text > add the below query to scope the search results for one web application based on its URL.

    {?{searchTerms} PATH://yourwebapplicationURL}
    

For more details check Configure properties of the Search Results Web Part in SharePoint Server


[Update]

You have the following options

  1. Create a Query rule with a block result with the above query, check the details steps at Manage query rules in SharePoint Server

  2. Create a Search Result Source in the site collection and use it in your search web part.

    • Site collection setting > Site Collection Administration > Search Result Source > add the above query.

    • in your search result web part, use this search result source.

2
  • thanks, but I guess the solution you suggested is need to be done at each search result webpart. Instead I want that all webpart will by default search with in the current site collection
    – cjs
    Nov 9, 2017 at 19:06
  • Please check the updated answer! Nov 9, 2017 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.