Sep 29 2022 06:29 AM
Hello all,
I wonder if anyone would be able to offer some help. My organisation has a SharePoint Online Intranet hub site which currently returns search results from across all sites (as specified within the search bar).
I have been asked to amend this so that when a search is performed, the search is limited to the current site only.
Can anyone suggest the best way to configure the search parameters so that users can only search the contents of the Intranet site?
Any suggestions would be much appreciated.
Sep 29 2022 06:45 AM
Hi @365User9
Firstly, Hub site shows the content from sites connected to it.
But, if you still want to restrict the search results, you can use below PnP PowerShell
Connect-PnPOnline -Url <Specify your site URL>
$web = Get-PnPWeb
# 1 for Tenant, 2 for Hub, 3 for Site, 0 for default behavior
$web.SearchScope = 1
$web.Update()
Invoke-PnPQuery