Query.GetQuerySuggestionsWithResults 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 GetQuerySuggestionsWithResults ( _
iNumberOfQuerySuggestions As Integer, _
iNumberOfResultSuggestions As Integer, _
fPreQuerySuggestions As Boolean, _
fHitHighlighting As Boolean, _
fCapitalizeFirstLetters As Boolean, _
fPrefixMatchAllTerms As Boolean _
) As QuerySuggestionResults
'Usage
Dim instance As Query
Dim iNumberOfQuerySuggestions As Integer
Dim iNumberOfResultSuggestions As Integer
Dim fPreQuerySuggestions As Boolean
Dim fHitHighlighting As Boolean
Dim fCapitalizeFirstLetters As Boolean
Dim fPrefixMatchAllTerms As Boolean
Dim returnValue As QuerySuggestionResults
returnValue = instance.GetQuerySuggestionsWithResults(iNumberOfQuerySuggestions, _
iNumberOfResultSuggestions, fPreQuerySuggestions, _
fHitHighlighting, fCapitalizeFirstLetters, _
fPrefixMatchAllTerms)
public QuerySuggestionResults GetQuerySuggestionsWithResults(
int iNumberOfQuerySuggestions,
int iNumberOfResultSuggestions,
bool fPreQuerySuggestions,
bool fHitHighlighting,
bool fCapitalizeFirstLetters,
bool fPrefixMatchAllTerms
)
Parameters
iNumberOfQuerySuggestions
Type: System.Int32Specifies the number of query suggestions the user would like to receive.
iNumberOfResultSuggestions
Type: System.Int32Specifies the maximum number of suggestions to return.
fPreQuerySuggestions
Type: System.BooleanSpecifies whether pre-query suggestions should be returned.
fHitHighlighting
Type: System.BooleanSpecifies whether parts of the query suggestion returned should be hit-highlighted.
fCapitalizeFirstLetters
Type: System.BooleanSpecifies whether the first letter in the query suggestion should be capitalized.
fPrefixMatchAllTerms
Type: System.BooleanSpecifies 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.
Remarks
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.