Share via


RankingParameter, classe (Microsoft.Office.Server.Search.Administration)

Represents a ranking parameter used for rank computation in Recherche de contenu d'entreprise dans Microsoft Office SharePoint Server 2007.

Espace de noms : Microsoft.Office.Server.Search.Administration
Assembly : Microsoft.Office.Server.Search (dans microsoft.office.server.search.dll)

Syntaxe

'Déclaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public NotInheritable Class RankingParameter
'Utilisation
Dim instance As RankingParameter
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class RankingParameter

Remarques

Use the RankingParameters property of the Ranking class to get the collection of ranking parameters for a Shared Services Provider (SSP).

Use an indexer to return a single ranking parameter from the RankParamCollection object. For example, assuming the collection is assigned to a variable named rankingParams, use rankingParams[index] in Microsoft Visual C# or rankingParams(index) in Microsoft Visual Basic, where index is the index number of the ranking parameter in the collection, or a string containing the name of the ranking parameter.

Notes

You cannot add new ranking parameters, or remove or change the names of existing parameters; you can modify only the ranking parameter's value.

Exemple

The following code example writes out the ranking parameter names and built-in values to the console window.

Prerequisites

Ensure a Shared Services 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 RankingParameterSample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
     //Replace <SiteName> with the name of a site using the Shared Services Provider.
                string strURL = "http://<SiteName>";
                Ranking searchRanking = new Ranking(SearchContext.GetContext(new SPSite(strURL)));
                RankParamCollection rankParams = searchRanking.RankingParameters;

                foreach (RankingParameter rankParam in rankParams)
                {
                    Console.WriteLine("NAME: " + rankParam.Name + "...VALUE: " + rankParam.Value);
                }
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
    }
}

Hiérarchie d'héritage

System.Object
  Microsoft.Office.Server.Search.Administration.RankingParameter

Sécurité des threads

Les membres statiques publics de ce type (Shared en Visual Basic) sont sécurisés au niveau des threads. Il n'est pas garanti que les membres d'instance soient sécurisés au niveau des threads.

Voir aussi

Référence

Membres RankingParameter
Microsoft.Office.Server.Search.Administration, espace de noms

Autres ressources

Amélioration de la pertinence
Présentation de l'architecture de pertinence de la recherche de contenu d'entreprise