Partager via


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

Provides an entry point to adjust the settings used for query-independent rank computation for calculating the relevance of Recherche de contenu d'entreprise results.

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 Ranking
'Utilisation
Dim instance As Ranking
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class Ranking

Remarques

Use the Ranking constructor of the Ranking class to initialize an object that provides an entry point to the Relevance object model.

For more information about search relevance, see Présentation de l'architecture de pertinence de la recherche de contenu d'entreprise.

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>";
                SearchContext context;
                using (SPSite site = new SPSite("http://yourSiteName"))
                {
                    context = SearchContext.GetContext(site);
                }
                Ranking sRanking = new Ranking(context);
                RankParamCollection rankParams = sRanking.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.Ranking

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 Ranking
Microsoft.Office.Server.Search.Administration, espace de noms