Access Search SearviceApplicaiton SharePoint 2010 Object model
public static void AccessSearchServiceApplication()
{
SPServiceContext context =
SPServiceContext.GetContext(SPServiceApplicationProxyGroup.Default, SPSiteSubscriptionIdentifier.Default);
SearchServiceApplicationProxy searchProxy = context.
GetDefaultProxy(typeof(SearchServiceApplicationProxy)) as SearchServiceApplicationProxy;
SearchServiceApplicationInfo ssai = searchProxy.GetSearchServiceApplicationInfo();
SearchServiceApplication application =
Microsoft.Office.Server.Search.Administration.SearchService.Service.SearchApplications.
GetValue(ssai.SearchServiceApplicationId);
Schema schema = new Schema(application);
Category cat = schema.AllCategories["Sharepoint"];
}
}
{
SPServiceContext context =
SPServiceContext.GetContext(SPServiceApplicationProxyGroup.Default, SPSiteSubscriptionIdentifier.Default);
SearchServiceApplicationProxy searchProxy = context.
GetDefaultProxy(typeof(SearchServiceApplicationProxy)) as SearchServiceApplicationProxy;
SearchServiceApplicationInfo ssai = searchProxy.GetSearchServiceApplicationInfo();
SearchServiceApplication application =
Microsoft.Office.Server.Search.Administration.SearchService.Service.SearchApplications.
GetValue(ssai.SearchServiceApplicationId);
Schema schema = new Schema(application);
Category cat = schema.AllCategories["Sharepoint"];
}
}
0 comments:
Post a Comment