SearchContext 类

请注意:此 API 现在已过时。

为共享服务提供程序 (SSP) 中表示的搜索服务实例。

继承层次结构

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

命名空间:  Microsoft.Office.Server.Search.Administration
程序集:  Microsoft.Office.Server.Search(位于 Microsoft.Office.Server.Search.dll 中)

语法

声明
<ObsoleteAttribute("This class is obsolete now. Please use SearchServiceApplication and SearchServiceApplicationProxy instead.")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SearchContext
用法
Dim instance As SearchContext
[ObsoleteAttribute("This class is obsolete now. Please use SearchServiceApplication and SearchServiceApplicationProxy instead.")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SearchContext

备注

SearchContext对象是SharePoint 企业级搜索**[N.Microsoft.Office.Server.Search.Administration]**对象模型的入口点。**GetContext()**方法返回站点、 服务器或您指定的 SSP 的搜索上下文。

备注

如果您使用SearchContext类的GetContext重载检索搜索上下文,我们建议您的代码实例化中使用的SPSite对象不再需要后,会释放语句来确保对象。在示例部分中的代码演示如何执行此操作。

有关SearchContext类和SharePoint 企业级搜索的管理对象模型的详细信息,请参阅Getting Started with the Search Administration Object ModelHow to: Return the Search Context for the Search Service Provider

示例

[C#]

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

}

线程安全性

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

另请参阅

引用

SearchContext 成员

Microsoft.Office.Server.Search.Administration 命名空间