SearchContext 类 (Microsoft.Office.Server.Search.Administration)

Represents the search service instance for a Shared Services Provider (SSP).

命名空间: Microsoft.Office.Server.Search.Administration
程序集: Microsoft.Office.Server.Search (在 microsoft.office.server.search.dll 中)

语法

声明
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public NotInheritable Class SearchContext
用法
Dim instance As SearchContext
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class SearchContext

备注

The SearchContext object is the entry point to the 企业级搜索N.Microsoft.Office.Server.Search.Administration object model. The GetContext method returns the search context for site, server, or SSP that you specify.

备注

If you use the GetContext overload of the SearchContext class to retrieve the search context, we recommend that your code instantiates the SPSite object within a using statement to ensure the object is released once it's no longer needed. The code in the Example section demonstrates how to do this.

For more information about the SearchContext class and the 企业级搜索 Administration object model, see 企业级搜索管理对象模型入门 and 如何:返回搜索服务提供程序的搜索上下文.

示例

[C#]

SearchContext context;
using (SPSite site = new SPSite("http://yourSiteName"))
{
     context = SearchContext.GetContext(site);

}

继承层次结构

System.Object
  Microsoft.Office.Server.Search.Administration.SearchContext

线程安全性

此类型的任何公共静态( Visual Basic 中共享)成员是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

参考

SearchContext 成员
Microsoft.Office.Server.Search.Administration 命名空间