SharePoint is designed to security trim your search results based on your user ID, a great feature to have in SharePoint as you don’t want search to return results of pages and content a user doesn’t have access too. However, this requires one extra step at times when moving a site from development to testing or even to production.
I’m sure this topic has been blogged about before as this isn’t the first time I’ve run into it, but I figured I would write a short post about it for anyone that encounters what would appear to be an issue with their Search in SharePoint.
The scenario: You have been building out a SharePoint site and you are ready to release it to the rest of your users. You have tested everything using your own credentials. You add a new user to the site with credentials equivalent to your end users and start testing with those credentials before going live. Everything is working as expected…until
The problem: Your perform a search…You go to your search page, search for some well known content that you know should be returned, but you get no results in SharePoint search. Your navigate to the page and you have access to it and can view the content you are searching for. To further test, you run a few more searches, but everything comes back with no search results.
The resolution: When SharePoint performs a crawl (incremental or full) it looks at all your content AS WELL AS who has permission to access the content. If you add users to your site, and immediately try a search before running a search crawl, the search index still has that the newly added user doesn’t have access to the content. So, if you are going to add new users to the site that need access to search, or you are going to be testing search, immediately after adding those new users, run an incremental crawl so your SharePoint search index can pick up that these new users actually have access to the content you are searching for.