In the first post Search Federation Options in SharePoint On-Premises I explained and demonstrated the steps required to setup Federated Search Results from 2 different farms. To show the results I used two seperate web parts. One confired to show results from Local SharePoint Result Source and other for the Remote resuls. In this post I will explain the steps required to merge the results and show them as Result Block.
To achieve this we hav to rely on two things.
A Query Rule
Allow us to setup rule to make a search query against a different result source or promote the results based on based on some condition and action. We can create Query Rules at Central Administration, Site Collection and Site Level. We can also control when to make this rule active.
A Result Block
A block of search results that will be displayed based ont he query rule. we can define how much results will be shown, provide “More” links etc.
For more information please read How To Customize SharePoint 2013 Search Results Using Query Rules and Result Sources
Let’s setup the Query Rule and Result block.
The image above is what my results look like before I started. Two web parts on the search results page. First I removed the web part from page. I saw something interesting. The refinement web part broke.
When I edit the webpart I found Target not found error. I may have set the default web part to use the remote result source and 2nd web part to local search results. Once I set the Refinement Targett to Local Search Results, it did not broke.
Creating the Query Rule
The same procedure is used to get federated results from Office365. The link to Technet is here https://technet.microsoft.com/en-us/library/dn197173.aspx