SearchServiceApplication.GetQuerySuggestions Method

Returns a collection of query suggestions that match the specified Search terms.

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


Public Function GetQuerySuggestions ( _
    properties As QueryProperties, _
    iNumberOfSuggestions As Integer, _
    fPreQuerySuggestions As Boolean, _
    fHitHighlighting As Boolean, _
    fCapitalizeFirstLetters As Boolean _
) As StringCollection
Dim instance As SearchServiceApplication
Dim properties As QueryProperties
Dim iNumberOfSuggestions As Integer
Dim fPreQuerySuggestions As Boolean
Dim fHitHighlighting As Boolean
Dim fCapitalizeFirstLetters As Boolean
Dim returnValue As StringCollection

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


  • iNumberOfSuggestions
    Type: System.Int32

    The number of suggestions to return.

  • fPreQuerySuggestions
    Type: System.Boolean

    true to return the pre-query suggestions; otherwise, false.

  • fHitHighlighting
    Type: System.Boolean

    true to highlight the returned query suggestion; otherwise, false.

  • fCapitalizeFirstLetters
    Type: System.Boolean

    true to capitalize the first letter in the query suggestion; otherwise, false.

Return Value

Type: System.Collections.Specialized.StringCollection
A collection of query suggestions that match the specified Search terms.


This method returns a collection of query suggestions that are generated based on the frequency of use.

See Also


SearchServiceApplication Class

SearchServiceApplication Members

Microsoft.Office.Server.Search.Administration Namespace