Share via


SearchContext, classe (Microsoft.Office.Server.Search.Administration)

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

Espace de noms : Microsoft.Office.Server.Search.Administration
Assembly : Microsoft.Office.Server.Search (dans microsoft.office.server.search.dll)

Syntaxe

'Déclaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public NotInheritable Class SearchContext
'Utilisation
Dim instance As SearchContext
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class SearchContext

Remarques

The SearchContext object is the entry point to the Recherche de contenu d'entrepriseN.Microsoft.Office.Server.Search.Administration object model. The GetContext method returns the search context for site, server, or SSP that you specify.

Notes

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 Recherche de contenu d'entreprise Administration object model, see Mise en route avec le modèle objet Administration de recherche de contenu d'entreprise and Procédure : renvoyer le contexte de recherche pour le fournisseur du service de recherche.

Exemple

[C#]

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

}

Hiérarchie d'héritage

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

Sécurité des threads

Les membres statiques publics de ce type (Shared en Visual Basic) sont sécurisés au niveau des threads. Il n'est pas garanti que les membres d'instance soient sécurisés au niveau des threads.

Voir aussi

Référence

Membres SearchContext
Microsoft.Office.Server.Search.Administration, espace de noms