SearchServiceApplicationProxy.AddContextValueFromIdForTuningQuery method
Adds a context value for the given TuningQuery. A context refers to any property in a query and each property has a dynamically allocated ID. In this method only two properties are used: the user issuing the query (UserId) and the user’s language (LanguageId). The dynamically allocated ID may be 0 or 1.
Namespace: Microsoft.Office.Server.Search.Administration
Assembly: Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)
Syntax
'Declaration
Public Function AddContextValueFromIdForTuningQuery ( _
searchObjectOwner As SearchObjectOwner, _
QueryId As Integer, _
ContextId As Integer, _
ContextVal As String _
) As Integer
'Usage
Dim instance As SearchServiceApplicationProxy
Dim searchObjectOwner As SearchObjectOwner
Dim QueryId As Integer
Dim ContextId As Integer
Dim ContextVal As String
Dim returnValue As Integer
returnValue = instance.AddContextValueFromIdForTuningQuery(searchObjectOwner, _
QueryId, ContextId, ContextVal)
public int AddContextValueFromIdForTuningQuery(
SearchObjectOwner searchObjectOwner,
int QueryId,
int ContextId,
string ContextVal
)
Parameters
searchObjectOwner
Type: Microsoft.Office.Server.Search.Administration.SearchObjectOwnerThe owner of the search site hierarchy.
QueryId
Type: System.Int32The tuning query; a query that you can use to customize the ranking model.
ContextId
Type: System.Int32The context ID; either 0 or 1.
ContextVal
Type: System.StringThe context value.
Return value
Type: System.Int32
The result. 0 indicates successful; -1 indicates an error.
Remarks
Use this method if you know the ID of your property. Otherwise, use AddContextValueFromKeyForTuningQuery().
Typically if there are multiple users and multiple queries, the most common user or query will be chosen. A TuningQuery can only have 1 user and 1 language.
See also
Reference
SearchServiceApplicationProxy class