Partager via


Query.GetQuerySuggestions Method

Returns a list of query suggestions matching the search terms typed in the search box.

Namespace:  Microsoft.Office.Server.Search.Query
Assembly:  Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)

Syntax

'Declaration
Public Function GetQuerySuggestions ( _
    iNumberOfSuggestions As Integer, _
    fPreQuerySuggestions As Boolean, _
    fHitHighlighting As Boolean, _
    fCapitalizeFirstLetters As Boolean _
) As StringCollection
'Usage
Dim instance As Query
Dim iNumberOfSuggestions As Integer
Dim fPreQuerySuggestions As Boolean
Dim fHitHighlighting As Boolean
Dim fCapitalizeFirstLetters As Boolean
Dim returnValue As StringCollection

returnValue = instance.GetQuerySuggestions(iNumberOfSuggestions, _
    fPreQuerySuggestions, fHitHighlighting, _
    fCapitalizeFirstLetters)
public StringCollection GetQuerySuggestions(
    int iNumberOfSuggestions,
    bool fPreQuerySuggestions,
    bool fHitHighlighting,
    bool fCapitalizeFirstLetters
)

Parameters

  • iNumberOfSuggestions
    Type: System.Int32

    Specifies the number of suggestions to return.

  • fPreQuerySuggestions
    Type: System.Boolean

    Specifies whether pre query suggestions should be returned.

  • fHitHighlighting
    Type: System.Boolean

    Specifies whether parts of the query suggestion returned should be hit-highlighted.

  • fCapitalizeFirstLetters
    Type: System.Boolean

    Specifies whether the first letter in the query suggestion should be capitalized.

Return Value

Type: System.Collections.Specialized.StringCollection
The list of query suggestions.

Remarks

Query suggestions are generated based upon the frequency of usage. The most frequently used search terms are returned.

See Also

Reference

Query Class

Query Members

Microsoft.Office.Server.Search.Query Namespace