Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

Posts Tagged ‘result sources’

Search – Result Sources

Posted by Jean Paul on April 18, 2014

In this article we can explore the Result Sources in SharePoint 2013 Search.

What is Result Source?

Result Source (Vertical) is a sub set or particular type of content. They are used to limit search results.

For example, we can use Result Source for a particular:

1. Content Type

2. Sub Site

Default Result Sources

SharePoint 2013 has 16 pre-configured result sources. The default one is Local SharePoint Results:


Central Administration > Search Service Application > Result Sources:


What is inside the Result Source?

We can closely examine a Result Source. Click on the Local Video Results result source. You will be taken to the page where it shows a Query Transform which controls the results.


The Query Transform text is below:

{searchTerms?} {?path:{Scope}} {?owstaxIdMetadataAllTagsInfo:{Tag}} (ContentTypeId:0x0120D520A808* OR (SecondaryFileExtension=wmv OR SecondaryFileExtension=avi OR SecondaryFileExtension=mpg OR SecondaryFileExtension=asf OR SecondaryFileExtension=mp4 OR SecondaryFileExtension=ogg OR SecondaryFileExtension=ogv OR SecondaryFileExtension=webm))

The searchTerms parameter represents the user-query-terms. The remaining text checks for Content Type Id and File Extensions. We can also create custom query transforms.

For more information on Query Transform you can check References section.

Each Result Source can be connected to the Search Navigation web part.


Creating a Result Source

Now we can try creating a new Result Source & Connecting it to the Navigation web part.


Our target is to create a Documents result source & connect to the navigation web part.

Following are the steps summary.


Step 1: Create new Result Source

Open Central Administration > Manage Service Applications > Search Service Application > Result Sources link


Choose the New Result Source link.

Step 2: Modify Query

In the appearing page, enter the name for the Result Source as Docs.


Then Launch the Query Builder and enter the following code.



You can also test the query using Test Query button. Once you are seeing results you are good.


We are using the KQL (Keyword Query Language) syntax to filter the result. The term {searchTerms} will be the user input keywords. Please make sure you have enough documents satisfying the result.

Step 3: Create Page

Each Result Source should be connected with a Result Page. To create a new page, open SharePoint Designer 2013 and navigate to your Enterprise Search Center site.


If you do not have SharePoint Designer 2013 installed, you can download it from:

Navigate to All Files > Pages library as shown below.


Copy & Paste the results.aspx and rename the new file as documentresults.aspx.


Close the Designer.

Step 4: Modify Page

We need to modify the new result page & choose our new result source. Inside SharePoint navigate to the new documentresults.aspx. In my case the URL was:


Choose the Edit Page option & bring the Search Results Web Part in edit mode.



Each Result Page will be having pre-configured web parts like:

1. Result web part

2. Refiner web part

3. Navigation web part

Choose the Change Query button & Select our new Result Source as shown below.


Click OK to close the web part editing & Save changes to the page.

We are now ready with the following:

· Result Source

· Result Page

We need to create the Navigation Link next.

Step 5: Create Navigation Link

From the Enterprise Search Center choose Site Settings. Then choose Search Settings link.


In the appearing page scroll down to the Configure Search Navigation.


Choose an existing link & Click the Edit button to understand the properties. Then click on the Add Link to create our new navigation link. Enter the Name and Navigation Link appropriately.


Please note that the Navigation Link is relative to the site.

Save changes to the dialog & Click Ok to save the navigation items.

Step 6: Testing the link

Type your new search keyword & click on the newly appeared Docs link.


You can see that the Results are filtered to show only document items. You can also see the Result URL has changed to http://hpvm/esearch/Pages/documentresults.aspx

This confirms our Result Source creation & testing.



In this article we have explored Result Sources in SharePoint 2013 Search with an example. In advanced scenarios, I recommend you to refer the KQL (Keyword Query Language) and FQL (FAST Query Language) to create complex search verticals.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »