Suggest
The following section explains how to integrate the Fredhopper Suggest service for type-ahead search suggestions in the search bar on your front-end web application.
Last updated
The following section explains how to integrate the Fredhopper Suggest service for type-ahead search suggestions in the search bar on your front-end web application.
Last updated
The Fredhopper Suggest service will return the defined search suggestions in a -format HTTP response. Each time a user inputs a keystroke in the search bar on the website, the front-end web application should send a GET HTTP request to the Fredhopper Suggest API with the text value and then display the response that is returned. The system can be designed to give a default response when a user clicks into the search bar but has not yet made a keystroke entry. Please contact your Technical Consultant for more information on how this can be configured. You might also decide to have the front-end wait for the user to type the first 3 characters of the search term before sending the first query to Fredhopper Suggest to retrieve the suggestions to display. This is in order to give them more focused and relevant results.
The format to retrieve suggestions for a specific term should be sent in the following query string format:
The JSON-format response that you receive will contain the suggestions for each defined index in the following format:
The following query string should be sent to get the suggestions for the keyword/keystrokes 'nic' from the universe 'catalog01' in the English (GB) locale:
In this particular example, the response that is returned contains the following two sections:
Two keyword suggestions for the terms nicam and nicky
One category suggestion for Mens / Nightwear (where additional information about the number of results and the Fredhopper Location String have been provided)
The different sections and the display fields within each section can be customised for your specific requirements. It is possible to make amendments to these at a later stage as requirements and business needs develop over time. You can contact your Technical Consultant for more information on this.