daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jan 16th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SPSite currentSite = SPContext.Current.Site;
  2. SearchQueryAndSiteSettingsServiceProxy settingsProxy = SPFarm.Local.ServiceProxies.GetValue<SearchQueryAndSiteSettingsServiceProxy>();
  3. SearchServiceApplicationProxy searchProxy = settingsProxy.ApplicationProxies.GetValue<SearchServiceApplicationProxy>("SEARCH SERVICE NAME");
  4. SearchObjectOwner serviceApplicationOwner = new SearchObjectOwner(SearchObjectLevel.Ssa);
  5. SourceRecord serviceApplicationResultSourceMedia = searchProxy.GetResultSourceByName("SEARCH RESULT SOURCE NAME", serviceApplicationOwner);
  6.    
  7. KeywordQuery query = new KeywordQuery("CURRENT SITE OBJECT");
RAW Paste Data
Top