2

We have a collection of sites that all live under a Hub Site. The sites within it are not subsites, just normal sites within the Hub's collection.

For the Hub site itself, when I run a search on the front-end it searches across all sites for results. The placeholder text of that search says "search across sites." For the internal sites, the initial search query only looks within its specific site contents and that placeholder text says "search this site."

One other note about the internal site search. The results from that search look like the screenshot attached. If I click on the "Hub Site" label, it does change the scope of the search to be across all sites.

I'm wondering if I can change the settings of the internal sites to behave as the Hub site does and search across all sites by default? And if I can, is it possible to configure this setting on a site-by-site basis?

sharepoint online internal site search results

Any and all help is appreciated, thank you!

2 Answers 2

4

There is not yet an option through the settings user interface, but it is an option you can set on each site via PnP PowerShell. If you have not already configured your machine to execute PnP PowerShell, follow these instructions first for installing and getting started, then:

Connect-PnPOnline -Url https://<<yourFullsiteurl>> -UseWebLogin

$web = Get-PnPWeb
$web.SearchScope = 2 # see below for possible SearchScope values
$web.Update()
Invoke-PnPQuery

0 = default, let SharePoint decide
1 = All sites in the organization
2 = All sites in this Hub
3 = Just this site

2
  • thanks for providing the script, I will take a look at that. What do you know about the upcoming search updates? microsoft.com/en-us/microsoft-365/… - Do you know if this SuiteNav search update will affect the current site search? Commented Feb 25, 2020 at 15:48
  • I watched a demo of MS Search a few months ago at Ignite, but couldn't get much info then about how this will impact or be impacted by existing SharePoint search configurations. Guess we'll just have to "wait and see".
    – willman
    Commented Feb 25, 2020 at 16:21
0

willman's script is correct and it is a quite new feature. It is more discussed here and have a check on it if you need more information:https://techcommunity.microsoft.com/t5/sharepoint/configure-modern-search-results-to-search-all-of-your/m-p/447334

Your Answer

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

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