Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SearchSuggestionCollection.AppendResultSuggestion | appendResultSuggestion method

Applies to Windows only

Appends a suggested search result to the list of suggestions to display in the search pane.

Syntax


searchSuggestionCollection.appendResultSuggestion(text, detailText, tag, image, imageAlternateText);

Parameters

text

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The text of the suggested result.

detailText

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The detail text for the suggested result.

tag

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The unique tag that identifies this suggested result.

If this suggested result is selected by the user, a resultsuggestionchosen event is fired. When the app handles this event, it can get the tag of the chosen result suggestion from the searchPaneResultSuggestionChosenEventArgs.tag property.

image

Type: IRandomAccessStreamReference

The image to accompany the results suggestion.

The image should be 40 x 40. Windows will scale or crop smaller or larger images.

imageAlternateText

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The alternate text for the image.

Remarks

You should use result suggestions instead of query suggestions only to display high-confidence results that take the user directly to the item instead of to a view that shows search results.

Suggested results include an image and optional detail text to display with the suggestion in the search pane. The image signals to the user that they are seeing results and not query suggestions. If an image for the result doesn't exist, you can use a generic image or icon that represents the result or result type.

You must listen for and handle the resultsuggestionchosen event if you want to provide result suggestions.

The search pane can display 5 suggestions, at most. Additionally, each separator you use takes the place of a suggestion and lowers the number of suggestions that you can display. Learn more about displaying suggestions in Guidelines and checklist for search.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.ApplicationModel.Search
Windows::ApplicationModel::Search [C++]

Metadata

Windows.winmd

See also

Search contract sample
Guidelines and checklist for search
Reference
SearchSuggestionCollection class
SearchPane.SuggestionsRequested event
SearchPane.ResultSuggestionChosen event
SearchPaneSuggestionsRequestedEventArgs class
SearchPaneSuggestionsRequestedEventArgs.Request property
SearchPaneSuggestionsRequest class
SearchPaneSuggestionsRequest.SearchSuggestionCollection property

 

 

Show:
© 2014 Microsoft