Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

The search query service trims the search results according to the rights of the user who issues the query.

The problem I have is content query search (SharePoint Search Service 14: FullTextSqlQuery) works fine for local Administrator users but returns zero results for all other local SharePoint 2010 users (AD is not involved). These users can access and view all documents so there does not appear to be any security issues within SharePoint. However, the log file shows the search results are all security trimmed out of the final result; the log does not contain any explicit error messages. So there appears to be an inconsistency between SharePoint and the search index with respect to access permissions.

Can anyone suggest how to diagnose the problem?

Thanks

share|improve this question

1 Answer 1

Because the web site is set up for anonymous access to the login page for Windows and Forms based logins, the issuing user is NT AUTHORITY\IUSR - not the logged in user. One workaround is to elevate the query code so that it executes under the application pool identity user, as follows:

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    try
    {
        results = query.Execute();
    }
    catch () {}
});
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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