FullTextIndexRankCollection Interface

Represents a full text index rank collection.

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

Syntax

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

Remarks

A [FullTextIndexRankCollection] is associated with a rank profile and represents relevance settings for a collection of FullTextIndexRankComponent objects.

Examples

This sample shows how to boost the proximity weight for the default full text index. Increasing the proximity weight will boost the ranking of documents that matches multi term queries where the terms appear near each other in the text.

            using System;
            using Microsoft.SharePoint.Search.Extended.Administration;
            using Microsoft.SharePoint.Search.Extended.Administration.Schema;
            
            namespace FullTextIndexRankComponentSample
            {
                class Program
                {
                    static void Main(string[] args)
                    {
                        try
                        {
                            SchemaContext schemaContext = new SchemaContext();
                            Schema schema = schemaContext.Schema;
            
                            //Fetch the rank profile named 'default' which is the default rank profile. 
                            RankProfile rankProfile = schema.AllRankProfiles["default"];
            
                            //Fetch the full text index ranks and iterate over the collection to find the component to update.
                            //The default full text index is by default called: 'content'.
                            FullTextIndexRankCollection fullTextIndexRanks = rankProfile.GetFullTextIndexRanks();
                            foreach (var rankComponent in fullTextIndexRanks)
                            {
                                if (rankComponent.FullTextIndexReference.Name.Equals("content"))
                                {
                                    int currentProximityWeight = rankComponent.ProximityWeight;
                                    Console.WriteLine("Current proximity weight: " + currentProximityWeight + " of rank component: " + rankComponent.FullTextIndexReference.Name);
                                    rankComponent.ProximityWeight += 10;
                                    rankComponent.Update();
                                    Console.WriteLine("New proximity weight: " + rankComponent.ProximityWeight + " of rank component: " + rankComponent.FullTextIndexReference.Name);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.ToString());
                        }
                    }
                }
            }
            

See Also

Reference

FullTextIndexRankCollection Members

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