Welcome!

The Latest Time Saving Tips for Your SharePoint Deployment

Corey Roth

Subscribe to Corey Roth: eMailAlertsEmail Alerts
Get Corey Roth via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Blog Feed Post

Querying Office 365 Groups with Search

I have been working with the new Office 365 Groups feature a little bit and I wanted to see how I could surface them from a regular SharePoint Online site.  In my example today, I have created two public groups and three private groups.

GroupList

My first thought was to use Search.  Ultimately, I knew the file storage behind groups was powered by a site collection.  I just need to figure out which WebTemplate was being used.  You can see the name of the site collection fairly easily by looking at one of the documents in search.  It’s simply stored at /sites/<GroupID>.  You can see your Group ID when creating the group initially.

CreateGroupWithGroupId

Using the REST API, we can then just assemble the URL with /_api/web onto the existing URL such as https://tenant.sharepoint.com/sites/GroupID/_api/web.  Looking through these results I found out that the WebTemplate for the site is simply named GROUP.  Now that we have this, we can query search using the WebTemplate managed property.  The query we want is simply:

WebTemplate:GROUP

You can type this directly into the keyword textbox in your Search Center.

GroupsInSearchCenter

Now wait a minute.  I am in five groups but it’s only showing me two.  After doing some research and some additional queries, I discovered that no matter what I did, search could never find private groups or the documents within them.  I am not sure if this is a bug or it is intentional, but as of right now you can only see public Groups with search.  Still this might be valuable to you, so you could always use this query inside the Content Search web part.

GroupsInContentSearch

I am hoping that we can query private groups as well in the future, but it’s still nice to be able to query your groups if you use a lot of public ones.

Read the original blog entry...

More Stories By Corey Roth

Corey Roth, a SharePoint Server MVP, is an independent consultant specializing in Cloud technologies such as Azure and Office 365. He also specializes in mobile development. Corey serves as the product manager for two cloud-first mobile app platforms: BrewZap and HappenZap.