Condividi tramite


CrawledProperty Interface

Represents a crawled 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 CrawledProperty
'Usage
Dim instance As CrawledProperty
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public interface CrawledProperty

Remarks

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 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 a specific managed property.

Examples

The following code example writes out a list of crawled properties, which are mapped to a specific managed property, to the console window.

            using System;
            using Microsoft.SharePoint.Search.Extended.Administration;
            using Microsoft.SharePoint.Search.Extended.Administration.Schema;
            
            namespace CrawledPropertiesSample
            {
                class Program
                {
                    static void Main(string[] args)
                    {
                        try
                        {
                            SchemaContext schemaContext = new SchemaContext();
                            Schema schema = schemaContext.Schema;
            
                            ManagedPropertyCollection props = schema.AllManagedProperties;
                            //Replace ManagedPropertyName with the name of a managed property.
                            ManagedProperty mProp = props["ManagedPropertyName"];
                            foreach (CrawledProperty cProp in mProp.GetCrawledPropertyMappings())
                            {
                                Console.WriteLine(cProp.Name);
                                Console.WriteLine(cProp.Propset);
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.ToString());
                        }
                    }
                }
            }
             

See Also

Reference

CrawledProperty Members

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

Other Resources

CrawledProperty