Query.GetQuerySuggestionsWithResults method

SharePoint 2013

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 QuerySuggestionResults GetQuerySuggestionsWithResults(
	int iNumberOfQuerySuggestions,
	int iNumberOfResultSuggestions,
	bool fPreQuerySuggestions,
	bool fHitHighlighting,
	bool fCapitalizeFirstLetters,
	bool fPrefixMatchAllTerms


Type: System.Int32

Specifies the number of query suggestions the user would like to receive.

Type: System.Int32

Specifies the maximum number of suggestions to return.

Type: System.Boolean

Specifies whether pre-query suggestions should be returned.

Type: System.Boolean

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

Type: System.Boolean

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

Type: System.Boolean

Specifies if the suggestions returned should be prefix matched with the query text.

Return value

Type: Microsoft.Office.Server.Search.Query.QuerySuggestionResults
The list of query suggestions.

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

This method differs from GetQuerySuggestions() in the type of return value. GetQuerySuggestionsWithResults returns a QuerySuggestionResults that is used by clients, for example the SharePoint Search REST API.