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 SabadraPosted Nov 30, 2015, 3:37 AM
sumit kumarPosted Nov 30, 2015, 2:47 AM
Prasham SabadraPosted Nov 27, 2015, 2:13 AM