Share via


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

Represents a crawled property in the Recherche de contenu d'entreprise metadata property schema.

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

Remarques

Crawled properties are the set of properties discovered by the Recherche de contenu d'entreprise index service component when crawling content. For more information about crawled properties, see Gestion des métadonnées.

Crawled properties are grouped by category, based on the protocol handler that is used. Use the GetAllCrawledProperties method of the Category class to get the collection of CrawledProperty objects representing the crawled properties for a specific category.

Crawled properties are mapped to managed properties to make them available for the Recherche de contenu d'entreprise user experience. Use the GetMappedCrawledProperties method of the ManagedProperty class to get the collection of CrawledProperty objects that represent the crawled properties mapped to specific managed property.

Exemple

The following code example writes out a list of crawled properties, which are mapped to a specific managed property, 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 analysées mappées sur une propriété gérée.

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.Collections;
using System.Text;
using Microsoft.Office.Server.Search.Administration;
using Microsoft.SharePoint;

namespace CrawledPropertiesSample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //Replace <SiteName> with the name of a site that uses the Shared Service Provider.
                string strURL = "http://<SiteName>";
                Schema sspSchema = new Schema(SearchContext.GetContext(new SPSite(strURL)));
                ManagedPropertyCollection props = sspSchema.AllManagedProperties;
                //Replace <ManagedPropertyName> with the name of a managed property.
                ManagedProperty mProp = props["<ManagedPropertyName>"];
                foreach (CrawledProperty cProp in mProp.GetMappedCrawledProperties(mProp.GetMappings().Count))
                {
                      Console.WriteLine(cProp.Name);
                      Console.WriteLine(cProp.Propset);
                 }
                 return;
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
    }
}

Hiérarchie d'héritage

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

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