Create SharePoint 2013 Online Search Result Sources and attach to Search Result page

Create SharePoint 2013 Online Search Result Sources and attach to Search Result page

Here we will discuss how to create search result sources in SharePoint 2013 online. And then how can we attach that result to a search result page which we have created earlier in this post. We can define result sources in a tenant, site collection or in site.

If you want to create a result source in SharePoint Online you can navigate to SharePoint Admin center -> Search -> Manage Result Sources.

SharePoint deveopment training course

SharePoint Online/2013/2016: Create Result Sources

First Open your SharePoint Online site, click on the Settings Icon and then Site settings. Then in the Site Settings page, go to the Search section and then click on Result Sources. This will open the Manage Result Sources page. Then click on New Result Source.

In the Add Result Source page, first, give a name and description. Then in the Protocol choose the option which is suitable for you. In my case, it is Local SharePoint because here, in this case, the index is associated with the current SharePoint farm.

If you are choosing Remote SharePoint means the index is associated with a different SharePoint farm. Similarly, you can choose for OpenSearch is the index is associated with the non-SharePoint search engine but that should support OpenSearch. Or You can also choose for Exchange for a Microsoft exchange server.

Then in Type, select what type of result you want to search: SharePoint Search Results or People Search Results.

In the Query Transform, you need to write the query. You can click on the Launch Query Builder and take the help of the UI to build the query. You can select the Keyword filter, Property filter.

In my case, I have written the query which will return items created by the current user who is running the search query and the file type should be pdf or docx. Means it will return only the pdf and docx files. You can also click on the TestQueryy button to preview the expected result. You can also click on the SORTING tab to sort the result based on a property.

The query will be:
{searchTerms} Author={User.Name} FileType=pdf FileType=docx

Create SharePoint 2013 Online Search Result Sources and attach to Search Result page
Create SharePoint 2013 Online Search Result Sources and attach to Search Result page

Then click on Save. Now it finishes the creation of the Result Source.

Attach Custom Result Source to SharePoint Online/2013/2016 Search Result Page

Now if you want to attach this custom Result Source to any search result page in SharePoint Online/2013/2016, then follow below steps:

Earlier I have created a Search Result page. Click on the settings icon then Site Contents and then Open Pages document library and then edit the search result page.

Then go to the Search Results web part and then click on Edit web part as shown in the fig below:


Create SharePoint 2013 Online Search Result Sources and attach to Search Result page
Create SharePoint 2013 Online Search Result Sources and attach to Search Result page

In the Search Results, web part properties click on the Change query in Search Criteria as shown in the fig below:

Create SharePoint 2013 Online Search Result Sources and attach to Search Result page
Create SharePoint 2013 Online Search Result Sources and attach to Search Result page

This will open the Build Your Query dialog box.
Just select the Result Source name which we have created before in the “Select a query” section. Then click on OK.

Create SharePoint 2013 Online Search Result Sources and attach to Search Result page
Create SharePoint 2013 Online Search Result Sources and attach to Search Result page

Now when you will search for something in the Search center then in this tab you will be able to see the results which are coming from the Result Source that you have created. See fig below:

Create SharePoint 2016 Online Search Result Sources and attach to Search Result page
Create SharePoint 2016 Online Search Result Sources and attach to Search Result page

You may like following SharePoint search tutorials:

Hope this will be helpful to you to Create SharePoint 2013 Online Search Result Sources and attach to Search Result page.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →