Which code segment should you use?

You are creating a Microsoft Office SharePoint Server 2007 application to increase the search capability of five site collections that belong to a single farm.

You need to retrieve all available search contexts for the Web site collection on which the application is initiated.

Which code segment should you use?

You are creating a Microsoft Office SharePoint Server 2007 application to increase the search capability of five site collections that belong to a single farm.

You need to retrieve all available search contexts for the Web site collection on which the application is initiated.

Which code segment should you use?

A.
string strSite = “http: //yourSiteName” SearchContext
srchContext = SearchContext.GetContext(new SPSite(strSite));

B.
SearchContext srchContext = SearchContext.
GetContext(ServerContext.Current);

C.
SearchService searchservice = new
SearchService(“Search_SSPS Name”, SPFarm.Local);
SearchContext srchContext = SearchContext.
GetContext(searchservice.Id.ToString());

D.
WASearchWebService1.SPSSearchWS.QueryService searchWebService
new WASearchWebService1.SPSSearchWS.QueryService();
searchWebService.Url = ” http: // myportal”;
Sea rchContext srchContext = SearchContext.GetContext(new
SPSite(searchWebService.ToString()));



Leave a Reply 0

Your email address will not be published. Required fields are marked *