Category Interface

Represents a Category object, controls settings for crawled properties in a category, and enables querying of crawled properties within the category.

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

Remarks

Use the AllCategories property of the Schema class to get the collection of property categories in the index schema. Use an indexer to return a single category from the CategoryCollection object.

Examples

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

            using System;
            using Microsoft.SharePoint.Search.Extended.Administration;
            using Microsoft.SharePoint.Search.Extended.Administration.Schema;
            
            namespace CategoriesSample
            {
                class Program
                {
                    static void Main(string[] args)
                    {
                        try
                        {
                            SchemaContext schemaContext = new SchemaContext();
                            Schema schema = schemaContext.Schema;
            
                            CategoryCollection categories = schema.AllCategories;
                            foreach (Category category in categories)
                            {
                                Console.WriteLine(category.Name);
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.ToString());
                        }
                    }
                }
            }
             

See Also

Reference

Category Members

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

Other Resources

Category