Search for Office 365 Group documents
This post is over a year old, some of this information may be out of date.
I just got a question from someone who wanted to know how to retrieve all the Office 365 Group documents he had access to.
When you are having a lot of groups in your organization, files could be spread across them. Search is in most cases the answer to finding your documents easily. So having a property on which you can flag them as a group document would be helpful in this case.
I did a quick search on my Office 365 tenant and checked the managed properties of a document living on a standard team site and one on a group site. Luckily there is a useful property which is already provided by SharePoint called: SiteTemplate which you can use to do your query.


So if you want to retrieve all search content from Office 365 Groups, all you have to do is search for: SiteTemplate=Group.

You can also configure this as a group search vertical so that it is easier for the user to limit their search scope.

Important: Only information of public groups is searchable. Private groups are not accessible for search, so this information cannot be retrieved. You can also test this by doing in a search in the private group itself. You will see that it would not find any documents.

Related articles
Programmatically Setting the Fetched Properties to an Extended Search Core Result Web Part
Fix: People Search Box Has Layout Problems When Used Outside a Search Center
Fix: Search Box Suggestions Layout Problem When Used Outside a Search Center
Report issues or make changes on GitHub
Found a typo or issue in this article? Visit the GitHub repository to make changes or submit a bug report.
Comments
Let's build together
Manage content in VS Code
Present from VS Code