Suggest Integration
Summary
The Suggest module enhances the user experience by providing intelligent search term suggestions as customers type. This helps users discover relevant terms, refine their queries, and save time by selecting a precise suggestion rather than typing the entire query.
How suggestions are generated
Suggestions are sourced from two main areas:
Product Information: Derived directly from product data within the Search database.
Search Activity: Based on analysis of recent, frequently used, and successful search terms.
Note: Once generated, suggestion data is stored independently from the live product database. Consequently, filtering suggestions by product attributes (for example, category) is not available by default.
Displaying suggestions
Beyond the suggested term itself, additional information can also be displayed to further guide the user:
Origin/description: Clarify the source or type of suggestion (for example, category or previous search term).
Expected hit count: Show the anticipated number of results for a suggestion.
Preview images: Display relevant product images alongside suggestions. Preview images must be activated in the Management Interface.
Hit counts
By default, the displayed hit counts are based on historical data from search log files. This means:
They might differ from the current, actual number of results
Suggestions for terms never searched before might not display a hit count
If precise, real-time exact hit counts are necessary, you can enable them in the Management Interface.
Caution: Enabling exact hit counts can significantly impact the performance of the Suggest import process.
Suggest Integration Methods
Using a proxy script for Suggest integration
Due to browser security policies (Same-Origin Policy), JavaScript running on the webshop domain cannot directly request data from a different domain or port where the Search application might be hosted.
Why a proxy is needed: If the webshop and Search application are on different servers or use different ports, a proxy script is typically essential.
How it works: The proxy script resides on the webshop server. The browser sends the Suggest request to this script. The script forwards the request to FactFinder and returns the response to the browser. Since the browser interacts with a script on its own domain, this is permitted.
Configuration: When initializing Suggest in the frontend code, use the URL of the proxy script as the request URL, not the direct URL of FactFinder.
Integrating Suggest via REST
The technical documentation of the REST-API is contained in the search application itself and can be accessed via [your NG server]/fact-finder/swagger-ui.html . It can be also accessed via the following URL:
Swagger Link: https://ng-demo.fact-finder.de/fact-finder/swagger-ui.html
The interface offers not only the parameter documentation, but also the option to test a query and review the result. The documentation was created with Swagger, you can use Swagger Codegen to generate a client for it and use it for your code.
Module data is accessed via the suggest
method.
Last updated
Was this helpful?