1

We have implemented post security trimming on a SharePoint 2013 search site and it works fine, except for the very odd display - if I do a Search without trimming on, it will show 10 results per page and page as normal using the numbered page links at the bottom of the page.

If I do a search with post security trimming on, it will show maybe 1 result on the first page, 1 results on the second page, 2 results on the 3rd page, etc, etc depending on what has been trimmed - almost like the results that are denied by the trimming are hidden but still count towards the 10 results per page. This seems a really odd way to do it and I'm very surprised this is out of the box functionality.

Does anyone know of a way to show all the trimmed results together so the results look "normal"? I did think of maybe removing items from the documentUrls IList used in the CheckAccess method but I'm not sure this is even possible or would produce the required results. Is there a parameter I need to see on the search results webpart or in the CheckAccess call?

Thanks for your help!

1 Answer 1

0

It appears that SharePoint 2013 changed the behaviour of security trimming and pagination at some point. I believe that the pagination is now calculated BEFORE trimming occurs, then items on the page are removed via the trimmer. This process naturally leads to gaps on the page (security trimmed results).

  • This is certainly not expected behaviour from a user's standpoint
  • This behaviour didn't occur in SharePoint 2010 (eg the behaviour has changed)

For these reasons I believe it's a bug / defect in SharePoint that's been accidentally introduced at some point, possibly as a result of another bugfix that's gone awry.

At this juncture I don't believe it's possible to fix (via a workaround) the pagination issues that you're seeing unless you implement your own back-end service that properly calculates page counts AFTER trimming occurs. I would be inclined to raise it as a bug / defect with Microsoft, as we are.

1
  • Thanks for the answer, and it's interesting that the behaviour was different in 2010! The way we have got round it for now is to increase the amount of results shown to the maximum allowed by the webpart (50). It's not perfect by any means, and does rely on the search returning some results to be visually ok but we couldn't see another way around it. I guess the logic is that say you had a million results and the post security trimming only allowed you to see result 999,999 - that's a lot of checking before getting to a result that can be displayed so better to basically ignore paging...
    – Orielton
    Commented Feb 9, 2015 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.