Domanda

When a Team is created it automatically creates a site collection in SharePoint for the Team created. I have 16 Teams created hence 16 site collections in SP Online. I am wondering if I can search across the Teams Sites on SharePoint from one site. So for example I have:

https://something.sharepoint.com/sites/test/
https://something.sharepoint.com/sites/test1/
https://something.sharepoint.com/sites/test2

I want to search content in all three sites from 'https://something.sharepoint.com/sites/test/'

I have created a result source and made it default in https://something.sharepoint.com/sites/test

but when I test my query I don't get any result back. Here is my query:

https://something.sharepoint.com/sites/test1 OR https://something.sharepoint.com/sites/test2 OR https://something.sharepoint.com/sites/test3 OR https://something.sharepoint.com/sites/test4 {SearchBoxQuery}*
È stato utile?

Soluzione

I suppose that you are using the OOB search “Search This Site”.

When you checking the path of “Search This Site”, you will find the path is like:

https://<technet>/sites/<site>/_layouts/15/osssearchresults.aspx?u=https://<technet>/sites/<site>&k=<keyword>

It limits the search in “u” parameter value “https://<technet>/sites/<site>” scope.

To search multiple sites, you need a search center.

Information about search center:

https://docs.microsoft.com/en-us/sharepoint/make-search-results-look-great

Or, send queries to _layouts/15/osssearchresults.aspx instead of using the results page settings as the parent in site or site collection level.

enter image description here

When searching with this setting, you will find the “u=https://<technet>/sites/<site>” query string will disappear., and then the it will search in the default result source of site or site collection level.

If you are using Modern search, it is different with the classic search.

Differences between the classic and modern search experiences in SharePoint Online

By default, the modern search only searches the current site. Click “SharePoint”, as shown in the image below, to search everything in tenant.

enter image description here

Using the managed property to limit the results. For example, search "path:<site1> OR path:<site2> <keyword>"

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top