> For the complete documentation index, see [llms.txt](https://docs.fact-finder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fact-finder.com/integration/suggest-integration.md).

# 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:

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](/integration/factfinder-search-integration/integrating-the-search-into-the-shop-system/integration-via-api-rest.md).

### 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](/integration/factfinder-search-integration/integrating-the-search-into-the-shop-system/integration-via-api-rest.md).

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fact-finder.com/integration/suggest-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
