I am getting UnauthorizedAccessException while creating KeywordQuery object. I have tried with all the overloaded method for KeywordQuery in SharePoint 2013. I am able to create SPSite object.
Below is the code:
using (SPSite site = new SPSite(url))
{
SearchServiceApplicationProxy proxy = (SearchServiceApplicationProxy)SearchServiceApplicationProxy.GetProxy(SPServiceContext.GetContext(site));
using (KeywordQuery keywordQuery = new KeywordQuery(site))//Unauthorised Access Exception on this line
{
//doing something with KeywordQuery object
}
}


Prasham SabadraRank #116 · 19.3K reputationPosted Nov 26, 2015, 9:13 PM EST
sumit kumar131 reputationPosted Nov 29, 2015, 9:47 PM EST
Prasham SabadraRank #116 · 19.3K reputationPosted Nov 29, 2015, 10:37 PM EST