Schema.AllManagedProperties 属性 (Microsoft.Office.Server.Search.Administration)

Gets the collection of ManagedProperty objects representing managed properties in the search schema for the Shared Service Provider.

命名空间: Microsoft.Office.Server.Search.Administration
程序集: Microsoft.Office.Server.Search (在 microsoft.office.server.search.dll 中)

语法

声明
Public ReadOnly Property AllManagedProperties As ManagedPropertyCollection
用法
Dim instance As Schema
Dim value As ManagedPropertyCollection

value = instance.AllManagedProperties
public ManagedPropertyCollection AllManagedProperties { get; }

属性值

A ManagedPropertyCollection object that represents the managed properties in the search schema.

示例

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

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

另请参阅

参考

Schema 类
Schema 成员
Microsoft.Office.Server.Search.Administration 命名空间