• Subcribe to Our RSS Feed
Browsing "Search"

Some Search Results Never Show Up With Other Similar Results

Jul 3, 2014   //   by Vince   //   Search, SharePoint 2010, SharePoint 2013  //  No Comments

The other day one of our users was experiencing a strange issue where different searches could turn up similar files, but the files could never be found using the same search terms (even though they had the same partial filename which was being searched for).  Take, for example, 2 PDF files named:

PN 1234567 LN 1234.pdf

PN 1234567 LN 6789.pdf

Searching for “1234567” would only show the first file, yet searching for “6789” would show the second file.  Searching for either “PN” or “LN” would again, only show the top file.  Both were scanned PDFs with no other significant metadata (they both had the same values).  Well Microsoft likes to think that they know better what it is that you’re really looking for, so SharePoint decides to hide what it considers to be duplicate files.  In this case, even though the PDFs were different and had different filenames, SharePoint’s algorithm for determining what is a (near) duplicate file was concluding that the files were indeed duplicates, and so hiding one result whenever the other was present.  One way of being able to see the duplicate files, is to configure the Search Results web part to “Show View Duplicates Link”, but all this does is provide a link in the document preview which, when clicked, will list the duplicate files.  However, this is not exactly very useful as we needed all of the files listed in the search results right off the bat.

Attempting to modify the Search Results web part directly in SharePoint Designer causes some funky errors with all of the Search related web parts (Search Box, Refiners, etc) on the page, which cannot be undone.  The best way I found to achieve this is to export the Search Results web part, then modify the web part file, and upload it again, and add it on the page using the following steps:

  1. Edit the page which the Search Results web part lives
  2. Choose “Export WebPart” and save it on your computer
  3. Edit the WebPart using Notepad, and search for “TrimDuplicates”
  4. You should see it in a JSON string looking like this “TrimDuplicates”:true
  5. Change the “true” to “false”
  6. Save the WebPart file
  7. Add a WebPart on your page and choose Upload WebPart
  8. Once your WebPart is uploaded, choose Add WebPart again and pick the Search Results web part that you just uploaded
  9. Voila.  Duplicates abound!