I had an interesting use case come up the other day with one of my clients. They had a Team in Microsoft Teams and created several private and shared channels in it. Those private and shared channels, of course, had their own SharePoint sites created as a result. And while the client could access all the channels and corresponding files from the Teams interface, they also wanted a quick way to search for all the files located in both the main site and the channel sites from the SharePoint interface. Want to hear the solution I proposed to them? Keep reading, then!
Before I explain the solution, it is important to understand the architecture of what happens behind the scenes. So when the client created a Team in Teams, it also created a SharePoint site to house all the standard channel documents (folder for each standard channel).
Example of a Standard Channel Folder on the Main Team Site
However, when the Private and Shared channels are created, it also creates separate SharePoint sites. I explained this concept here. Each Private Channel and each Shared channel end up with their own SharePoint site that is not linked to the main site at all!
Example of a Private Channel Site created in SharePoint as a result of a Private Channel in Teams
If the user was in Teams, they could search for the file in the main site and channel sites by using the Teams Search interface:
Search the main team site and channel sites in Teams
However, if the user accesses the same site in SharePoint, there is no mechanism to search for all documents simultaneously.
If the user navigates to the main team Site and executes a search, it only searches that particular site (all the standard channel folders on that site).
Search Results when searching the main Team site in SharePoint
If the user navigates to the Private or Shared SharePoint site and executes a search, it once again only searches that particular site.
Search Results when searching Private Channel site in SharePoint
There is just no way to search all the sites at once that belong to a Team from the SharePoint interface. Unless…
The solution we came up with was very simple and sort of genius 😊 Hub Sites. As you probably know from my previous articles, one of the core functionalities of hub sites is that it allows searching all the associated sites at once from the main Hub Site.
So all we need to do here is register our main Team Site as a Hub Site. To do so:
- Navigate to the Microsoft 365 Admin Center, by clicking the App Launcher > Admin
- Navigate to the SharePoint Admin Center by clicking on SharePoint under Admin centers
- Click on Active sites under Sites to see a list of all the sites you have
- From the Active Sites list, click the checkbox next to the Team Site and Register it as a Hub
- Give the Hub a name and click Save
- Once the Team site is registered as a Hub, it will get the Hub menu, but most importantly, it will also convert the Search this site search box on that main site into the Search across sites search box
But here is where also the magic happens. If we had other sites that we wanted to be part of the Hub, we would need to manually associate them to the Hub Site we just registered/created. However, for the channel sites, this works differently. Once you register the main site as the hub, all the channel sites are also automatically associated with the Hub! You will notice this phenomenon if you navigate to any of the Private or Shared Channel sites.
So if you navigate to the main Team Site (that you registered as a Hub) and execute a search from there, its search box will now search the main (parent) team site + all associated sites (private and shared channels sites) at once (since this is the core functionality of Hubs)!
NOTE: Make sure to wait a few hours after registering “the site as a hub” for the search/indexing of all associated sites to kick in.
You will notice that the SharePoint search results above align with the Teams interface’s search results.
Optionally, you can even build out the Hub navigation linking all the private and shared channel sites via the Hub menu, but this is quite a manual process and probably not necessary in our use case.
So the problem is solved, and I have another happy client! 😊