Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The GenerateQueryString method of the QueryResultBase class processes the query template and replaces placeholders with run-time values.
Namespace: Microsoft.SharePoint.Portal.WebControls
Assembly: Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)
Syntax
'Declaration
Protected Overridable Function GenerateQueryString ( _
strKeyword As String, _
rgScopeList As ArrayList, _
strWhereAndPart As String, _
<OutAttribute> ByRef strSavedQuery As String _
) As String
'Usage
Dim strKeyword As String
Dim rgScopeList As ArrayList
Dim strWhereAndPart As String
Dim strSavedQuery As String
Dim returnValue As String
returnValue = Me.GenerateQueryString(strKeyword, _
rgScopeList, strWhereAndPart, strSavedQuery)
protected virtual string GenerateQueryString(
string strKeyword,
ArrayList rgScopeList,
string strWhereAndPart,
out string strSavedQuery
)
Parameters
strKeyword
Type: System.StringKeywords to include in the query.
rgScopeList
Type: System.Collections.ArrayListAn array of search scopes to include in the query.
strWhereAndPart
Type: System.StringWHERE clause to include in the query.
strSavedQuery
Type: System.StringOut parameter that receives the resulting query.
Return Value
Type: System.String
String that contains the resulting query.
Remarks
The GenerateQueryString method replaces placeholders in the query template with run-time values. The placeholders are indicated by "%__ __%" substrings. The following table shows the placeholders implemented in this method, and a short description for each.
Placeholder |
Condition |
---|---|
%__keywordinput__% |
Replaced with the keywords specified in the search box. |
%__keywordinputforcontains__% |
Replaced with the keywords specified in the search box, with encoding for query. |
%__UserIdentity__% |
Replaced with the current user logon value, domain_name\user_name. |
%__Scopes__% |
Replaced with the specified search scopes. |
%__querystring(id)__% |
Replaced with HttpRequest.QueryString["id"], if specified. |
%__formfield(id)__% |
Replace with HttpRequest.Form["id"]. |
Your can extend the template translation process by overriding this method in your derived class.