TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
Vipul Kelkar
When:
3 Aug 2014 12:11 PM
Last revision by
Sandro Pereira
(MVP, Microsoft Community Contributor)
When:
12 Oct 2014 2:40 PM
Revisions:
14
Comments:
10
Options
Subscribe to Article (RSS)
Share this
Engage!
Wiki Ninjas Blog
(
Announcements
)
Wiki Ninjas on Twitter
TechNet Wiki Discussion Forum
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
SharePoint 2013: Working with Result Sources to limit search results
SharePoint 2013: Working with Result Sources to limit search results
Article
History
SharePoint 2013: Working with Result Sources to limit search results
Table of Contents
Create sample data for search
Test the search results with SharePoint search webparts
Create and configure a new result source
Configure the search webpart to utilize the Result source
While working with SharePoint search solutions, we might come across a scenario where we are required to limit the search results to specific content. There were Search scopes in SharePoint 2010 to achieve this. The Search Scopes were replaced with the "Result Source" in SharePoint 2013. The purpose of this article is to create a custom Result source and we will take a simple example of limiting the search results to a specific document library in our site collection using result source.
I am using a SharePoint online site collection for the example and all the search configuration for result sources are done in tenant administrator. The similar settings can also be done in an On-Premise SharePoint environment. So lets get started.
Create sample data for search
To get some results in search, I created some sample files. A file in shared documents library and a PAGE in Pages library.
Test the search results with SharePoint search webparts
Notice that both the items have "Landscape" keyword in their title, and that is the keyword on which we are going to search in this example. Now, these items should be crawled in order to be able to fetch them in search results. I don't have to bother about the crawling as I am working with Office 365, where we do not have control over the crawl schedule and it is automatically taken care of. However, if you are working in an On-Premise environment, make sure you have crawled the site collection before proceeding ahead.
Now, we will insert the SharePoint search web parts on a page in our site collection.
Let us search with the keyword "Landscape" and we will see that both the items we created are retrieved in the search results.
Create and configure a new result source
The purpose of creating a Result Source is that we want to limit the search results only from the document library and ignore the results from PAGES library. Navigate to your tenant administrator and go to the Search administration page. If you are working in On-premise environment, Navigate to
Central Administration -> Manage service applications -> Search Service application -> Result Sources
The search administrator page in tenant administrator will look like this.
Click on Manage Result Sources and create a New Result Source
Enter the details for the Result Source
Click on "Launch Query Builder"
As shown in the below image, select the property "Path", criteria "Contains" and enter the manual value as URL of the document library to which the search results should be restricted.
Several other criteria can be set as per the requirement to filter the search results.
Hit SAVE and our result source will be created.
Configure the search webpart to utilize the Result source
Now edit the search web parts that we inserted in the initial steps and set the Result Source of the search results web part to the one we created.
Apply the changes, Save the page and again Search for the keyword "Landscape". Now, the results only from the "Documents" library will be fetched.
The Allitems.aspx page is shown because it is a part of the document library. This page can be trimmed in the search results. Have a look at Steve Mann's article here:
http://stevemannspath.blogspot.co.uk/2013/04/sharepoint-2013-search-removing-junk.html