Query.HighlightStringValue Method
Applies to: Microsoft SharePoint Server 2010 search
Highlights all the occurrences of the specified query terms in a string.
Namespace: Microsoft.Office.Server.Search.Query
Assembly: Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)
Syntax
'Declaration
Public Function HighlightStringValue ( _
strValue As String, _
fLastTermByPrefix As Boolean, _
fQuerySuggestions As Boolean, _
<OutAttribute> ByRef fHasHighLight As Boolean _
) As String
'Usage
Dim instance As Query
Dim strValue As String
Dim fLastTermByPrefix As Boolean
Dim fQuerySuggestions As Boolean
Dim fHasHighLight As Boolean
Dim returnValue As String
returnValue = instance.HighlightStringValue(strValue, _
fLastTermByPrefix, fQuerySuggestions, _
fHasHighLight)
public string HighlightStringValue(
string strValue,
bool fLastTermByPrefix,
bool fQuerySuggestions,
out bool fHasHighLight
)
Parameters
strValue
Type: System.StringThe string to highlight the query terms in.
fLastTermByPrefix
Type: System.BooleanSpecifies whether the last query term must match by prefix. true if any term in the strValue element that matches the prefix of the last term in the query should be highlighted; otherwise false, if all terms in the strValue element should be highlighted only if they match the query terms exactly.
fQuerySuggestions
Type: System.BooleanSpecifies the string is a query suggestion. true if the string is a query suggestion; otherwise false.
fHasHighLight
Type: System.BooleanSpecifies whether the string contains any highlighted terms.
Return Value
Type: System.String
The string with the specified terms highlighted.