ManagedProperty Interface

Represents a managed property in the index schema.

Namespace:  Microsoft.SharePoint.Search.Extended.Administration.Schema
Assembly:  Microsoft.SharePoint.Search.Extended.Administration (in Microsoft.SharePoint.Search.Extended.Administration.dll)

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Interface ManagedProperty
'Usage
Dim instance As ManagedProperty
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public interface ManagedProperty

Remarks

Managed properties are the set of properties that are available to the search user experience. To create a managed property, use the Create method of the ManagedPropertyCollection class. To delete a managed property, use the Delete() method of the ManagedProperty class.

Examples

The following code example writes out the full list of managed properties to the console window.

            using System;
            using Microsoft.SharePoint.Search.Extended.Administration;
            using Microsoft.SharePoint.Search.Extended.Administration.Schema;
            
            namespace ManagedPropertiesSample
            {
                class Program
                {
                    static void Main(string[] args)
                    {
                        try
                        {
                            SchemaContext schemaContext = new SchemaContext();
                            Schema schema = schemaContext.Schema;
            
                            //Fetch all managed properties
                            ManagedPropertyCollection properties = schema.AllManagedProperties;
                            foreach (ManagedProperty property in properties)
                            {
                                Console.WriteLine(property.Name);
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.ToString());
                        }
                    }
                }
            }
             

See Also

Reference

ManagedProperty Members

Microsoft.SharePoint.Search.Extended.Administration.Schema Namespace

Other Resources

ManagedProperty