Remove duplicates on the standard SharePoint search results page

If you don’t know what the “Remove Duplicate Results” feature is, than you can find a great introduction in this great article How “Remove Duplicate Results” works in FAST Search for SharePoint by leonardocsouza.

Suppose now, that you need to set the Remove Duplicate Results setting to false, but you don’t have a Search Center configured on your SharePoint site.

In this case your search reasults are redirected to the standard results page osssearchresults.aspx. This page however cannot be edited. Do you have to set up a Search Center Site just to be able to turn this feature off?

The answer is, as it often happens, depends.

On one hand, a good rule of thumb is to never edit SharePoint core files (if you have an alternative). In this case though we can set the url to our osssearchresults.aspx file on the site collection level. This allows us to use our own version of osssearchresults while leaving the original intact for further use.

On the other hand, if you are trying to customize the search results page, maybe you could use a search center and avoid the risks comming from playing with SharePoint core files.

The osssearchresults.aspx file is on the SharePoint root path under layouts.

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\osssearchresults.aspx

Remove duplicates on the standard SharePoint search results page 1Create a copy

Remove duplicates on the standard SharePoint search results page 2Edit the custom osssearchresults.aspx and find this div

<div class="srch-sitesearchmaintop">
  <SearchWC:CoreResultsWebPart runat="server" ShowActionLinks=false ChromeType="None"/>
</div>

Set the RemoveDuplicates attribute to false

<div class="srch-sitesearchmaintop">
  <SearchWC:CoreResultsWebPart runat="server" ShowActionLinks=false ChromeType="None" RemoveDuplicates="false"/>
</div>

You can find the attributes documentation here

Now navigate to the Search Collection which search results page you want to customize and go into Search Settings

Remove duplicates on the standard SharePoint search results page 3You can change the path to your osssearchresults.aspx file in the filed under “Results page URL”

Remove duplicates on the standard SharePoint search results page 5Change it to the name of your custom page.

Remove duplicates on the standard SharePoint search results page 6Save and go back to your site. The Remove Duplicates feature should now be deactivated.

Hope this helps you guys.

Leave a Reply

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


3 − = two