# Exact Search

Exact Search is a lookup feature. It matches query terms exactly to values in fields marked for Exact Search. It does not apply spelling correction (including diacritics), partial matching, or fuzzy logic.

For example, if a product has the article number **"MB 502E"**:

* A search for **"MB 502E"** will return the product.
* A search for **"502E"** or **"MB502E"** will **not** return it. Those values do **not** match exactly.

Exact Search is useful when:

* You want precise control over matches, for example article numbers, SKUs, or keywords.
* You want to avoid false positives from fuzzy matching.
* Performance matters, and strict matching reduces the result size.

**Combine it with fuzzy search** to balance precision and flexibility.

### Modes

The **Exact Search mode** setting defines the default behavior. This applies when the request does not set a mode.

Available modes:

* **Disabled**: Exact search is off; only fuzzy search is used.
* [**Article number search (ANS)**](#article-number-search-ans): Uses the ANS legacy compatibility mode (see below).
* **Only exact search**: Returns results only from exact matches. **You may get zero results** if nothing matches. In this mode, no [Fallback Vector Search](https://docs.fact-finder.com/docs/modules/vector-search/fallback-vector-search) will run (if active).
* **Exact search or fuzzy search as a fallback**: Tries Exact Search first; falls back to fuzzy search if no matches are found.
* **Exact search + fuzzy search on entire query**: Combines exact and fuzzy results. Uses all query words for exact match and the entire query string for fuzzy search.
* **Exact search + fuzzy search on remaining parts of the query**: Combines results; performs fuzzy search only on query parts that did not produce an exact hit.

{% hint style="warning" %}
**Important:** Exact Search only checks fields that are [configured](https://docs.fact-finder.com/docs/basic-settings/fields#field-types) for “exact search”.
{% endhint %}

### Field configuration and compatibility

To use a field for Exact Search, enable it in your [field configuration](https://docs.fact-finder.com/docs/basic-settings/fields). Use the **Exact Search** checkbox in the field editor.

<figure><img src="https://883583471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTV1CIVFU3DJKhWzkqLAG%2Fuploads%2FSJDX5htFy5dkah87ZO1y%2Fexact1.png?alt=media&#x26;token=06475616-fb3c-41eb-b725-363d39d9883c" alt=""><figcaption></figcaption></figure>

In the fields overview, you will see:

* **Exact search** (orange): whether a field is enabled for Exact Search.
* [**Article Number Search (ANS)**](#article-number-search-ans) (purple): whether an ANS pattern exists.

If you already use ANS, FactFinder tries once to enable Exact Search for those fields. In many setups, you do not need to enable fields manually.

#### Supported field types (current limitations)

Right now, Exact Search supports only a subset of field configurations. Supported fields include:

* Fields of type `ALPHANUMERIC`
* CSI fields of type `TEXT`
* Faceted fields that are not used for [Geo](https://docs.fact-finder.com/docs/modules/geo)
* Filterable fields with a single value (not a list) of type `GTIN` per product
* Fields with a single value per product that is unique for that channel

Because of these limits, some ANS fields may need manual updates.

### Shop Integration & Configuration

#### Setting the default mode

A default mode can be selected on the [Search algorithm](https://docs.fact-finder.com/docs/basic-settings/search-algorithm) page.

#### Overwriting the mode per request

The mode can be overwritten per search and Suggest API requests using the `exactSearchMode` parameter.

### Testing in the Cockpit

You can test exact search modes in the Cockpit. This does not overwrite your saved settings. Use it to pick a good default for your shop.

<figure><img src="https://883583471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTV1CIVFU3DJKhWzkqLAG%2Fuploads%2FoSbYaXfpsWy0MXdQzTZr%2F2026-03-03_ExactSearch.png?alt=media&#x26;token=3f9ee82c-7bc6-4cfc-aac5-95bc18da89d1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Info:** A similarity of 100% in fuzzy search is not the same as an “exact match” in Exact Search.
{% endhint %}

Exact hits will be clearly marked as such in the scorecards:

<figure><img src="https://883583471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTV1CIVFU3DJKhWzkqLAG%2Fuploads%2FdumX6EemdaEhIq7xLBhk%2Fimage.png?alt=media&#x26;token=59c4fabe-3899-4638-a176-3d7539f41289" alt=""><figcaption></figcaption></figure>

### Article Number Search (ANS)

Article Number Search (ANS) is an **older search method**. Exact Search replaces it over time.

To make the transition easier, **Article number search** mode keeps your current setup. It also lets you benefit from Exact Search.

If you used ANS before, FactFinder uses `LEGACY` behavior by default. Each response also returns `exactSearchMode`. This tells you what was applied.

#### Supported use cases (and why Exact Search replaces ANS)

Legacy ANS has a few limitations:

* It depends on regex patterns that must fully define the format. This is not always realistic.
* It offers limited control over search behavior.
* For multi-part queries, it often requires explicit logical operators (`||`) to split query parts.

Exact Search addresses these limits with word-wise lookups. It does not need regex patterns.

#### How it works with Exact Search

When you select **Article number search**, the system tries Exact Search first. It uses it instead of the legacy ANS method.

**Behind the scenes:**

* The system selects the ANS fields as usual, depending on the ANS mode.
* It then checks whether *all* those selected fields are also enabled for Exact Search.
* Only if all required fields are enabled for Exact Search, the request is translated from ANS to Exact Search.

**Which ANS fields are considered:**

* If ANS was set to **NEVER**, no fields are considered.
* If ANS was set to **ALWAYS**, all configured ANS fields are considered.
* If ANS was set to **DETECT**, only ANS fields that match the query via the configured regex are considered.

**Which exact search mode is applied (if translation is possible):**

* ANS **NEVER** → **Disabled**
* ANS **ALWAYS** → **Only exact search**
* ANS **DETECT** → **Exact search + fuzzy search on remaining parts of the query**

**How to tell what happened:**

* If exact search was applied instead of ANS, the result flag `isArticleNumberSearch` will be set to `false`.
* The search response includes `exactSearchMode` that shows the exact-search mode that was actually applied.

{% hint style="warning" %}
**Note:** Searches that used to count as ANS may now count as Exact Search. This can affect [campaign criteria](#campaigns) such as “The search is an article number search”.
{% endhint %}

**Behavior differences (improvements) in `LEGACY` mode:**

* ANS **DETECT** does not require `||` operators anymore to achieve the same behavior as before.
* With ANS **ALWAYS**, products that match the query exactly but do not match any ANS pattern can still be found via exact search, which reduces the chance of zero-hit results.

{% hint style="info" %}
**What this means for you:** You can keep your integration as-is. You still benefit from the improved Exact Search behavior. No code changes are needed.
{% endhint %}

### Module interactions

#### Suggest

Exact Search only applies to “product number” suggestions. Other types ignore the Suggest search mode. They follow the [Suggest Search strategies](https://docs.fact-finder.com/docs/basic-settings/suggest/suggest-searchsettings).

#### Campaigns

There are two [campaign](https://docs.fact-finder.com/docs/discovery/campaigns) triggers you can use with Exact Search:

<figure><img src="https://883583471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTV1CIVFU3DJKhWzkqLAG%2Fuploads%2FtKaeKE3mMt0ZBM7lPseO%2Fimage.png?alt=media&#x26;token=5b4d3287-13c8-4fa3-830d-c5d7d74c6161" alt=""><figcaption></figcaption></figure>

1. **The search result contains exact hits**:

   This becomes true when your search finds at least one exact match.
2. **The search result does not contain any exact hit(s)**:

   This becomes true when your search doesn't find any exact matches.

Use these triggers when you want to react to exact hits. If you want to make sure a campaign triggers for either of those two features, you can add an explicit \<link: exact search trigger condition> to the campaign.

#### Vector Search

Even if vector search is active, Exact Search uses your regular database, not the vector database. As a result:

* Exact matches will not show a vector score in the Cockpit’s diagnostic search.
* Exact matches will not follow the weights you configured for vector search.
* Exact matches may appear with much higher scores than fuzzy search results.
