We have a web service, implemented on our WFE servers, that performs multiple actions on SharePoint, one of which being the search.
Here is how I am doing it:
using (SPSite siteCollection = new SPSite(path)) { KeywordQuery keywordQuery = new KeywordQuery(siteCollection); keywordQuery.QueryText = strSearch; keywordQuery.KeywordInclusion = KeywordInclusion.AllKeywords; keywordQuery.AuthenticationType = QueryAuthenticationType.NtAuthenticatedQuery; SearchExecutor searchExecutor = new SearchExecutor(); ResultTableCollection resultTableCollection = searchExecutor.ExecuteQuery(keywordQuery); var resultTables = resultTableCollection.Filter("TableType", KnownTableTypes.RelevantResults); var objrelevantResults = resultTables.FirstOrDefault(); DataTable objResultDataTable = objrelevantResults.Table; } The problem: This only works with the farm account. A regular account, even with full control permission on the site collection used on the search doesn't work.
Is there a way around this or the user has to be permissioned at a higher level?