Calling the Personalized Searc...

Auto-Suggestions

An AUTO_SUGGESTIONS request returns results—both suggested search terms and products—as the customer types each character in their search term. Therefore, a Personalized Search API call is made each time the customer types a new character.

Personalized Search is both typo-tolerant and word order–toleratant, so it can return suggestions even when the customer misspells one or more words (for example, headlites instead of headlights) or puts the words of a search term in an unusual order (for example, chairs outdoor instead of outdoor chairs).

The recommended interval to wait between auto-suggestions request calls is 250 ms on key presses and 30 ms on focus.

POST
Request
Body Parameters
suggestions
required
Object
The set of parameters that define an auto-suggestions request.
Example Auto-Suggestions Request
Responses
200


Auto-Suggesting Products

In addition to suggesting search terms as the customer types, Personalized Search can suggest products in the auto-suggestions results.

Including products in an auto-suggestions response is available not only to Personalized Search clients that have Personalized Site Search in their contract but also to clients that only have Personalized Category Pages in their contract.

To use this function, add the recordQueries object to the request, with the value of its typeOfRequest parameter defined as "SEARCH".

Here's an example of an auto-suggestions request to include products in the results:

Example Auto-Suggestions with Suggested Products Request


Refer to the recordQueries definition in Personalized Site Search Query Request for more information about its required and optional parameters.