How users only able to search within the sub site only : SharePint 2019 On Prem Modren Team Site

adil 1,431 Reputation points
2023-08-27T13:51:08.12+00:00

Hi,

I have SharePoint 2019 On Prem and i reated a Team Site and some sub sites inside it, and crawled the whole Team Site Collection, here as per my requirement in each Team Sub Site search only work for scope : sub site only not whole SIte Collection , users only able to search within the sub site.

Search in SubSite

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Emily Du-MSFT 51,846 Reputation points Microsoft External Staff
    2023-08-29T08:35:48.93+00:00

    Sorry for the above misleading answer. Here is a new answer for correction and clarify.

    1.The Search settings in the Site settings (subsite) only effect classic search. If you use modern search, the search result page is designed, and cannot be customized.

    After setting Search settings in the Site settings (subsite), please go to Site contents -> Return to classic SharePoint, then do classic search, it redirects to custom search result page you have set in the Search settings.

    Note: You should wait for a few time, at least 30 minutes.

    2.Your requirement is to make users in the subsite can only search contents in the subsite. Is it right? It can be achieved through Permission settings. Users who have permissions for the subsite but not for the site collection can only search the contents in the subsite.

    (1)Go to Site settings of sub site -> Site permissions -> Stop Inheriting Permissions -> Create a new group.

    User's image

    2.Re-grant permissions to users in the subsite groups again.

    1

    3.Remove all site collection groups.

    2

    4.Go to Site settings of site collection -> Site permissions -> Remove users that don't need permission for the site collection.

    5.Do a full crawl.

    After above steps, when users search in the subsite, they can only search the contents in the subsite.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. Abdulla Walli 80 Reputation points
    2023-08-27T20:22:32.4866667+00:00

    To limit the search scope to a sub-site only in SharePoint 2019 On Prem, you can specify the search settings for a site collection or a site. As a Global Administrator or SharePoint Administrator, you can specify how search should behave for a classic site collection or a site. The shared Search Box at the top of most classic pages uses these search settings. Any settings you specify on site collection level applies to all sites within that site collection, unless you specify other settings for the site.

    To specify search settings for a site collection, follow these steps:

    1. On the site, select Settings, and then select Site settings. If you don’t see Site settings, select Site information, and then select View all site settings.
    2. Under Site Collection Administration, click Search Settings.
    3. To specify a Search Center, in the Search Center URL box, type the URL of the Search Center site.
    4. To change which search result page queries are sent to, in the section Which search results page should queries be sent to?, clear Use the same results page settings as my parent, and then select one of the following:
    • Send queries to a custom results page URL. Enter the URL. Custom URLs can be relative or absolute, and can also include special tokens, such as {SearchCenterURL}. Example: /SearchCenter/Pages/results.aspx or http://server/sites/SearchCenter/Pages/results.aspx.
    • Turn on the drop-down menu inside the search box, and use the first Search Navigation node as the destination results page.

    Note that it may take up to 30 minutes before changes take effect <sup>1</sup>.


  2. Emily Du-MSFT 51,846 Reputation points Microsoft External Staff
    2023-08-28T08:49:18.7066667+00:00

    For modern search, the requirement cannot be achieved in the SharePoint 2019. It is designed and cannot be customized.

    As a workaround, you could use classic search. Go to Site contents of subsite to do Search, it will only return results in the subsite.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.