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)


Public Function GetQuerySuggestions ( _
    iNumberOfSuggestions As Integer, _
    fPreQuerySuggestions As Boolean, _
    fHitHighlighting As Boolean, _
    fCapitalizeFirstLetters As Boolean _
) As StringCollection
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, _
public StringCollection GetQuerySuggestions(
    int iNumberOfSuggestions,
    bool fPreQuerySuggestions,
    bool fHitHighlighting,
    bool fCapitalizeFirstLetters


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


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

See also


Query class

Query members

Microsoft.Office.Server.Search.Query namespace