Compartir a través de


: CrawledProperty (Clase) (Microsoft.Office.Server.Search.Administration)

Represents a crawled property in the Enterprise Search metadata property schema.

Espacio de nombres:
Ensamblado: Microsoft.Office.Server.Search (in microsoft.office.server.search.dll)

Sintaxis

'Declaración
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public NotInheritable Class CrawledProperty
'Uso
Dim instance As CrawledProperty
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class CrawledProperty

Comentarios

Crawled properties are the set of properties discovered by the Enterprise Search index service component when crawling content. For more information about crawled properties, see Administración de metadatos.

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 Enterprise Search 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.

Ejemplo

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 Procedimiento para recuperar las propiedades rastreadas asignadas a una propiedad administrada.

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());
            }
        }
    }
}

Jerarquía de herencia

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

Seguridad de subprocesos

Todos los miembros estáticos públicos (compartidos en Visual Basic) de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancia sean seguros para los subprocesos.

Vea también

Referencia

CrawledProperty (Miembros)
Microsoft.Office.Server.Search.Administration (Espacio de nombres)