Share-n-dipity

SharePoint serendipity is the effect by which one accidentally discovers something fortunate, especially while looking for something else entirely. In this case, it is the occassional musings, observations, and Ouija board readings about the phabulously

You Get More Results in the Query Builder for a Web Part Than When the Web Part is Rendered on the Page in SharePoint 2013

You Get More Results in the Query Builder for a Web Part Than When the Web Part is Rendered on the Page in SharePoint 2013

  • Comments 1
  • Likes

I’ve had this issue happen to me a while back and then I saw two other people have the same problem in the last couple of weeks so I decided to do a quick post on this.  The scenario usually manifests itself something like this:  you are working on some kind of custom search application – like doing a query based a custom managed property or something like that.  You edit the search web part properties and open up the query builder.  When you run your query in there you see all of your search results being returned.  However, when you save the web part changes and load the page, you don’t see all of the search results; you get a smaller number of results returned.

One of my initial efforts at fixing this was to change the trim duplicates property in the web part to false, even though I knew I did not have any real duplicates in my search results (they were all site collections, something I would not have thought we would even do a duplication check on).  That did not fix the problem anyways, but one of the folks here suggested that using that property in the web part settings may not be sufficient to actually resolve the problem.

His suggestion was to export the web part and save it locally.  If you open it up in an editor like Notepad, look for property called DataProviderJSON, and you will see a sub-property in there called TrimDuplicates.  By default it is true, so change it to false and then import the .webpart back into a site collection and add it to the page.  I was happily surprised to find that this did in fact fix this problem for me, and I started getting back a full set of results.  I burned a lot of hours though trying to get this working “as expected” out of the box, so hopefully this post will save you some time.

Comments
  • Hi, I've seen this alot as well and wrote a PowerShell snippet which can edit this for you over at http://techmikael.blogspot.no/2013/12/duplicate-trimming-in-sharepoint-2013.html The real question is why the trimming is so coarse with those four checksums. I always turn it off as it gives more customer support questions to leave it on. Better to tell them to remove real duplicates which might show up. Thanks, Mikael Svenson

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment