Calling the Personalized Searc...

Auto-Suggestions

An AUTO_SUGGESTIONS request returns suggested search terms 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
Path Params
name
required
String
The client's account (for example, "a-1db61f7a") as it appears in the value of channel used in the Engine API request to obtain the search token.
instance
required
String
The client's account environment. The value must either be "p" for production or "d" for development.
domain
required
String
The client's domain (for example, "product.monetate.me") as it appears in the value of channel used in the Engine API request to obtain the search token.
Header Parameters
Content-type
required
String
The value must be "application/json."
Body Parameters
searchToken
required
String
A token used to authenticate the search request obtained by sending a request to the Engine API. See "Obtaining a Search Token" in "Calling the Personalized Search API" for more information.
suggestions
required
Object
The set of parameters that define an auto-suggestions request.
Example Auto-Suggestions Request
Curl
JS
Python
Ruby
Responses
200


Displaying Both Search Terms and Products

Personalized Search can return products along with suggested search terms as the customer types their search query.

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 request that includes both auto-suggestions and product search:

Example Auto-Suggestions and Product Search Request


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