For the complete documentation index, see llms.txt. This page is also available as Markdown.

Suggest Integration

Integrate Suggest to show search term suggestions, previews, and hit counts while users type.

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:

  1. Product Information: Derived directly from product data within the Search database.

  2. 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

Because of browser security policies such as the Same-Origin Policy, JavaScript running on the webshop domain cannot directly request data from a different domain or port where the Search application is 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 REST API documentation is part of the search application and is available at [your NG server]/fact-finder/swagger-ui.html. You can also access it here:

Swagger Link: https://ng-demo.fact-finder.de/fact-finder/swagger-ui.html

In addition to the parameter documentation, you can test requests and inspect the results directly. Because the documentation is built with Swagger, you can also use Swagger Codegen to generate a client.

Module data is accessed via the suggest method.

Last updated

Was this helpful?