다음을 통해 공유


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.String

    The string to highlight the query terms in.

  • fLastTermByPrefix
    Type: System.Boolean

    Specifies 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.Boolean

    Specifies the string is a query suggestion. true if the string is a query suggestion; otherwise false.

  • fHasHighLight
    Type: System.Boolean

    Specifies whether the string contains any highlighted terms.

Return Value

Type: System.String
The string with the specified terms highlighted.

See Also

Reference

Query Class

Query Members

Microsoft.Office.Server.Search.Query Namespace