Compartir a través de


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

Represents a managed 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 ManagedProperty
'Uso
Dim instance As ManagedProperty
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class ManagedProperty

Comentarios

Managed properties are the set of properties that are available to the search user experience. For more information about managed properties, see Administración de metadatos.

Use the AllManagedProperties property of the Schema class to get the collection of managed properties in the Shared Service Provider's search schema.

Use an indexer to return a single managed property from the ManagedPropertyCollection object. For example, assuming the collection is assigned to a variable named mProperties, use mProperties[index] in Microsoft Visual C# or mProperties(index) in Microsoft Visual Basic, where index is a string containing the name of the managed property.

To create a managed property, use the Create method of the ManagedPropertyCollection class. For steps on how to do this, see Procedimiento para crear una propiedad administrada.

To delete a managed property, use the Delete method of the ManagedProperty class. For steps on how to do this, see Procedimiento para eliminar una propiedad administrada.

Ejemplo

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 Procedimiento para recuperar las propiedades administradas para un proveedor de servicios compartidos.

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

Jerarquía de herencia

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

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

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