SearchServiceApplication.AddContextValueFromKeyForTuningQuery 方法

添加给定TuningQuery的上下文值。上下文是指在查询中的任何属性,并且每个属性具有一个动态分配的 id。在此方法中使用只有两个属性: 用户发出的查询 (UserId) 和用户的语言 (LanguageId)。动态分配的 ID 可能会是 0 或 1。

命名空间:  Microsoft.Office.Server.Search.Administration
程序集:  Microsoft.Office.Server.Search(位于 Microsoft.Office.Server.Search.dll 中)

语法

声明
Public Function AddContextValueFromKeyForTuningQuery ( _
    searchObjectOwner As SearchObjectOwner, _
    QueryId As Integer, _
    ContextKey As String, _
    ContextVal As String _
) As Integer
用法
Dim instance As SearchServiceApplication
Dim searchObjectOwner As SearchObjectOwner
Dim QueryId As Integer
Dim ContextKey As String
Dim ContextVal As String
Dim returnValue As Integer

returnValue = instance.AddContextValueFromKeyForTuningQuery(searchObjectOwner, _
    QueryId, ContextKey, ContextVal)
public int AddContextValueFromKeyForTuningQuery(
    SearchObjectOwner searchObjectOwner,
    int QueryId,
    string ContextKey,
    string ContextVal
)

参数

  • QueryId
    类型:System.Int32

    优化查询。一个查询,您可以使用自定义的排序模型。

  • ContextKey
    类型:System.String

    上下文键 ;"LanguageId"或"UserId"。

返回值

类型:System.Int32
结果。0 表示成功。-1 指示错误。

备注

如果您知道您的属性,例如UserId或LanguageId的键,请使用此方法。否则,请使用AddContextValueFromIdForTuningQuery()

通常如果有多个用户和多个查询,将会选择最常见的用户查询。TuningQuery只能有 1 个用户和 1 语言。

另请参阅

引用

SearchServiceApplication 类

SearchServiceApplication 成员

Microsoft.Office.Server.Search.Administration 命名空间