Search
Details about the Search user journey
The onSearch callback
onSearch callbackSearchAppState onSearch(SearchInfo searchInfo, SearchUserJourney userJourney);onSearch: async (searchInfo, searchUserJourney)SearchAppState onSearch(SearchInfo searchInfo, SearchUserJourney searchUserJourney)onSearch: async (searchInfo, searchUserJourney)// This is deprecated and is kept here for reference only
SearchUserJourney.AppState onSearch(SearchInfo searchInfo, SearchUserJourney userJourney);public SearchUserJourney.AppState onSearch(SearchInfo searchInfo, SearchUserJourney searchJourney) {
// The searchItem will have the relevant part of the end-users search request
// and will automatically be in English, even if the user spoke in a
// different language.
String searchItem = searchInfo.getItem().getDescription();
// Launch SearchResultsActivity using "searchItem"
// ...
return new SearchResultsAppState(SUCCESS);
}onSearch: async (searchInfo, searchUserJourney) => {
var searchItem = searchInfo.item.description;
// Perform UI operation using "searchItem"
// ...
searchUserJourney.setSuccess();
return SearchUserJourney.AppState.SEARCH_RESULTS;
},@override
SearchAppState onSearch(SearchInfo searchInfo, SearchUserJourney searchUserJourney) {
String searchItem = searchInfo.item.description
// Update SearchResultsWidget using "searchItem"
// ...
return new SearchResultAppState(SUCCESS);
}Sample Utterances that could trigger the search
SearchInfo Parameter
SearchInfo ParameterSupported AppStates
AppStatesSupported Conditions
Assistant Prompts
Last updated