The importance of (SharePoint) Search

Office 365 offers many possibilities to build solutions in order to better communicate and collaborate within an organization. The cloud-based service has many capabilities to store information: OneDrive for Business, Outlook, Yammer, OneNote and of course SharePoint Online. Likewise, retrieving or accessing information can be done in various ways. For one, all of the O365 products have their own search functionality. Also, there is Delve. This is an enormously powerful tool that brings information to the user.

In this piece we focus on the search functionality of SharePoint Online. This search functionality is a crucial component of the O365 environment. In fact, performing search queries is inherently tied to our everyday internet use. Proof of this are the enormous amount of searches executed daily by the different search engines. Just the Google search engine alone performs more than 3 billion searches every day. The use of ‘search’ to find the correct information has become part of our online DNA.

The use of ‘search’ to find the correct information has become part of our online DNA.

The above findings can be extrapolated to the corporate collaboration environment (in Office365) of a company. A good, comprehensive and deliberate search area in Office 365 is of great importance. Just think how frustrating it can be not finding the desired information. Needless to say this comes at the expense of the user adoption. It is difficult to embrace an environment which frustrates you as anvind end user. In addition a solid search center is important to guarantee the productivity of the end user. No one wants to spend (and lose) hours seeking for his/her information.

Imagine one central, instantly searchable space for information stored on the whole Office 365 platform; Yammer, SharePoint or even OneDrive for Business. Furthermore, imagine that this search can be performed without leaving the current webpage. Wouldn’t that be great? In this post, we take a closer look at the ability to, starting from the SharePoint Search center, search into your personal OneDrive for Business files.

How to: Search for your personal OneDrive for Business files within SharePoint Online

In SharePoint Online, it is possible to define different Result sources. These sources allows a user to limit searches to certain content. These result sources can be used within the SharePoint Search Verticals. These are customized for searching specific content. They display search results that are filtered and formatted for a specific content type or clas.  By default, SharePoint has four predefined search verticals: Everything, People, Conversations and Videos. These search verticals are in fact different pages. In case one of these verticals is selected, a user is navigated to another page.

The out-of-the-box search box on the search center page looks like this;

search verticals

The previously mentioned standardized set of Result Sources can be modified; Additional result sources can be created, or one can remove non-applicable result sources. In this blog, a special MyOneDrive Result Source will be added. This result source allows a user to search within his own OneDrive files, without leaving the SharePoint environment. Especially for new users, this is very useful.

1.    Create a new Result Source

First of all, a special a new Result Source has to be created. Before adding the result source, verify that you use the administrator account. You can directly navigate to the page by using the link below:

Or you can follow this procedure

Here you can create a New Result Source.

  • In the General Information section, provide a name (something like SharePoint Online OneDrive) and short description.
  • For the Protocol use local SharePoint.
  • In the Query Transform section you have to specify the to-be-used Query for the new Result Source. The transform replaces contextual query variables with values pertaining to the query context. Use the following query {searchTerms} path:

 Query transform

Don’t forget to replace tenant name with your actual tenant name.

  • Click Save

2.   Create search-results page for OneDrive for Business

Once the search result source is created, it can be used in the search center. Navigate to you your SharePoint search center. Normally, this will is a separate site collection. Since every search source is actually a separate page (.aspx), a new page is to be created first.

  • Go to your Site contents > Pages.
  • Add a new page. Give it an appropriate name (OneDriveResults) and
  • Click create.

add page

3.    Configure the new Search Results page

Now that a new Search Results Page is created, it has to be configured so that only OneDrive for Business results are shown.

  • Open the newly created page in Edit-mode
  • Edit the Search Results Web-part

search results web part

  • In the Search Results Web Part tool pane, click Change Query.
  • In the Select a query section; choose the newly created result source

Result Source Web Part

UnfoSearch Results 1rtunately, simply selecting the new OneDriveforBusiness result source is not the end. Using this new result source, without further configuration would cause items/files of colleagues showing up.

Recalling the new result source, this is not illogical. The search results are limited to the elements following the url: For example, files shared by a colleague on their OD4B follow the same path.

To address this issue, an additional property filter is needed. As can be seen on the image above, every user’s name is incorporated in the URL of his/her OD4B. Knowing that a person’s name is included in the URL is key to the solution.

In the Change query window the following steps are required

  • In the Select Property filter, click –Show all Managed Properties—

managed properties

  • Look for the SPSiteURL property
  • Then select ‘Contains’ and ‘Name of the user who runs the query’.

name of the user

  • By clicking add Property filter, the Query text should like this: {searchboxquery} SPSiteURL:{User.Name}
  • Now anything that matches the searchbox query your personal my site will be shown. To limit this so that only documents (which are stored on your OneDrive for Business) are shown, add the following to your search query. (FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf)
  • Click OK.

4.   Add search vertical

Now the search results are limited to a user’s personal OneDrive for Business files. The last thing to do is add ‘MyOneDrive’ as a search vertical to your search results page.

  • Go to Search Settings via the site settings page.
  • In the Configure Search Navigation, click add link.

search vertical

  • Click two times OK.

Now that everything is set, the search page can be used. To test if all things are set up correctly, 5 documents were added to my OD4B.


When using the MyOneDrive search vertical, a wildcard search returns the following results:



Having an integrated OneDrive for Business Search Source in your corporate SharePoint environment is relatively simple and can be done with standard out-of-the box functionality. Doing so, a user doesn’t have to switch between different tabs and stays within the SharePoint environment. This enhances the search experience, which undoubtedly has a positive effect on the user adoption of the environment.


Frederik De Wieuw

Frederik De Wieuw

Business Consultant @ Spikes


Frederik De Wieuw works as a Business Consultant for Spikes NV. He has a passion for finding appropriate Office 365 solutions to create added business value. In order to do so, he likes to explore the limits of the standard Out-of-the box functionalities.