The search suggestion feature basically covers two functional areas. First is just to suggest words, based on the users input, utilizing spell correction or prediction (also known as auto completion). The second functional area is also often referred to as search-as-you-type, where, based on the users input, specific items are already looked up, before the user actually has completed typing a word or even fired up the search.
This model combines both functional areas and provides access to both - the suggested words and the items found while using the predicted words.
This model supports various types of items that are being suggested, like products, categories, brands, content pages as well merchant provided search phrases. For each type, there is a Suggestions implementation available and accessible through this model: ProductSuggestions, CategorySuggestions, BrandSuggestions, ContentSuggestions, and CustomSuggestions.
For each type of suggestions, the actual suggested items (like products) can by obtained, and, on the other hand, a list of terms is provided which were used to lookup the found items. The terms can be used to present a advanced user experience in the storefront, e.g. show auto completed words, spell corrections and so on. The SuggestModel script API will always create suggestions with Autocorrections regardless of the value of "Search Autocorrections" search preference.
10
null
for insufficient search input
null
for insufficient search input
null
for insufficient search input
null
for insufficient search input
null
for insufficient search input
Suggested products, brands and categories, as well as corrected and completed terms are specific to the given category or one of it's sub categories.
For example, in the specified category "television", the search term "pla" will be auto completed to "plasma" (instead of e.g. "player") and only televisions will be included in the list of suggested products.
The maximum number of suggestions that can be queried are defined as MAX_SUGGESTIONS.
The resulting search phrase is used to lookup the actual items, like products or categories (search-as-you-type).
In order to access the processed terms, one can use the SearchPhraseSuggestions.getSuggestedTerms() method of each of the respective results returned by the methods in this model.