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"];

}
}

0 comments:

Post a Comment

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at sharepointprogrammingblogger@gmail.com .

Copyright (c) 2010 @ myshaepointwork.blogspot.com. All rights are reserved.Do Not Copy.

@ Learning SharePoint.com