Share via


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

Provides access to the property metadata management system for Recherche de contenu d'entreprise.

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 Schema
'Utilisation
Dim instance As Schema
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class Schema

Remarques

The Schema class is the entry point for managing the Recherche de contenu d'entreprise metadata schema for a Shared Service Provider's search service. To use the Schema object, you must do the following:

  1. Add references to your application for the following dlls:

    • Microsoft.SharePoint.dll

    • Microsoft.Office.Server.dll

    • Microsoft.Office.Server.Search.dll

  2. Specify the Shared Service Provider for the search service using the SearchContext object. For more information about ways to retrieve the search context, see Procédure : renvoyer le contexte de recherche pour le fournisseur du service de recherche.

The following topics contain code samples demonstrating how to use the Schema object model to perform various metadata management tasks programmatically:

Procédure : récupérer les propriétés gérées pour un fournisseur de services partagés

Procédure : créer une propriété gérée

Procédure : supprimer une propriété gérée

Procédure : récupérer les propriétés analysées pour une catégorie dans le schéma de recherche

Procédure : récupérer les propriétés analysées mappées sur une propriété gérée

Procédure : mapper une propriété analysée à une propriété gérée

Exemple

The following code example writes out the full list of managed properties to the console window. For a complete, step-by-step walkthrough of this sample code, see Procédure : récupérer les propriétés gérées pour un fournisseur de services partagés.

Prerequisites

Ensure a Shared Service Provider is already created.

Project References

Add the following Project References in your console application code project before running this sample:

  • Microsoft.SharePoint

  • Microsoft.Office.Server

  • Microsoft.Office.Server.Search

using System;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Server.Search.Administration;
using Microsoft.SharePoint;

namespace ManagedPropertiesSample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //Replace <SiteName> with the name of a site using the Shared Service Provider.
                string strURL = "http://<SiteName>";
                Schema sspSchema = new Schema(SearchContext.GetContext(new SPSite(strURL)));
                ManagedPropertyCollection properties = sspSchema.AllManagedProperties;
                foreach (ManagedProperty property in properties)
                {
                    Console.WriteLine(property.Name);
                }
            }
            catch(Exception ex)
            {
                 Console.WriteLine(ex.ToString());
            }
        }
    }
}

Hiérarchie d'héritage

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

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 Schema
Microsoft.Office.Server.Search.Administration, espace de noms