Filtering SharePoint Search Results by Content Source

Working for one my projects we were looking for a solution to only retrieve search results for a specific Content Source. In our scenario we had a External Content Type that was linked to a “FilteredEMail” view of a CRM database.

We connected CRM to SharePoint in this scenario because searching in CRM for a specific email was a big problem and slowed down the complete CRM system.

What there was implemented on CRM was a small button to open a window  / frame to a SharePoint Search page. On this SharePoint search page you could search for the specific Mail and then the result would link you back to CRM.

Creating the External Content Type wasn’t that hard. The main thing here If you would also like to search trough your external content type is to define a field as a Timestamp field in order to enable incremental search.

Timestamp field

For us this was very important because we were dealing with more than a million items. After we had the external content type in place and created the profile pages we crawled the complete set of emails.

We than needed to create a result source in order to retrieve only the information from the external content type. On the Search Service Application page we clicked on the ‘Result Sources’ menu option and created a new Search Result Source.

New Result Source

After setting these properties we opened the Query Builder. Within the query builder you do not have a default option of some sort to start filtering the results by a specific content source.

When I took a closer look at the property filter drop down after selecting “— Show All Managed properties —“ you have a property called “ContentSource”. We selected this and filled in the value of our content source.

Query Builder

After that we used the default options for the rest of the properties and saved the result source. Following this hunch resulted in a result source that only returns items of a specific content source.

New Result Source 2

After that we created a “Display Template” to refer back to CRM if you are curious on how we accomplished that please let me know.

Related Posts

Forcing a Device Channel Device channels are a way of using different master pages for different devices. MSDN describes the functionality as followed:   “Browsing ...
Offline Installation SharePoint 2013 In many situation you would like to do a offline installation of SharePoint 2013 or you are required to do a offline installation because you do not h...
User automatically removed from SharePoint Group During my current project we received an access request from a user. We did what we normally do, we checked the request and added the user in the appr...
Unable to start User Profile Synchronization Service A few days ago I wrote a post about loading modules in PowerShell by default: “Load modules by default when opening PowerShell”. Today we had to setup...
PowerShell Scripts During my current project we are using a lot of PowerShell scripts to administrate the environment and make development easier for us. In this post...
SharePoint License Versions versus Versions As a SharePoint developer you do not often get the question what SharePoint version do we need to install. In many situations we see that the Enterpri...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.