> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/commerce/search/understanding-autocomplete-suggestions.md).

# Understanding Autocomplete Suggestions

Provide your visitors with a fast, intuitive search experience by surfacing relevant search suggestions as they type. This guide explains how AB Tasty Search builds, normalizes, and ranks terms for your autocomplete suggestions index.

### Overview

The Autocomplete index (also referred to as the Suggestions index) is a dedicated index that powers the <kbd>/autocomplete</kbd> endpoint. It delivers real-time, highly relevant search terms to visitors as they begin typing in your search bar, reducing friction and helping them find products faster.

To ensure your search suggestions are always accurate and helpful, AB Tasty automatically blends and updates two primary sources of data:

1. **Past Search Queries:** Real search queries typed by your website visitors over the last few weeks.
2. **Catalog-Based Whitelist:** A verified list of allowed terms extracted directly from your active product catalog and custom configurations (such as synonyms).

### How it Works

The autocomplete pipeline runs daily to rebuild your suggestions index with zero-downtime. This means your suggestions stay fresh and reflect both catalog updates and seasonal search trends without interrupting your live site experience.

#### 1. Data Collection and Extraction

Each day, the system retrieves two sets of raw data:

* **Recent Search Volume:** The most recent searches from unique visitors on your site over the past 8 weeks.
* **Current Product Catalog:** The latest version of your connected product catalog.

#### 2. Building the Whitelist (Allowed Terms)

To prevent typos, irrelevant phrases, or broken strings from appearing as suggestions, AB Tasty generates an "allowed" vocabulary (the whitelist) from your product data.

* **Attribute Tokenization:** The system extracts single words and full phrases from key catalog columns (like product names and categories).
* **Synonym Enrichment:** Synonyms configured on your catalog index are automatically integrated into the whitelist.
* **Normalization:** Accents, punctuation, quotes, and double spaces are cleaned up to establish a pristine list of display forms.

#### 3. Cleaning and Merging

Once the search history and whitelist are prepared, they are cross-referenced to finalize the actual terms shown to users:

* **Validation:** A visitor's search query only becomes a suggestion if it successfully matches an allowed term in the catalog-derived whitelist.
* **Standardizing Display:** Suggestions are formatted with proper capitalization and matching catalog accents. Even if many users type a search term in lowercase or without accents, the autocomplete box will display the correct, clean format from your catalog.
* **Plural and Singular Consolidation:** Grammatical variations (like plurals and singular forms) are merged to keep your suggestion dropdown clean and redundant-free.

### Key Features

#### Useful on Day One (Fallback Suggestions)

If you are onboarding a brand new site or have low search volume, your suggestion box won't be empty. AB Tasty automatically injects whitelist-only terms derived from your catalog. This ensures high-value products and categories remain suggestible from your very first visitor.

#### Dynamic Ranking Logic

Suggestions are not presented in a random order. When a user types, AB Tasty ranks suggestions dynamically based on:

* **Popularity (Count):** Suggestions that represent queries typed by a larger number of unique visitors are prioritized.
* **Relevance (Results Returned):** Broader search terms that match more catalog items are preferred.

{% hint style="info" %}
Longer, more specific phrases are favored when search scores are equal.
{% endhint %}


---

# 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.abtasty.com/commerce/search/understanding-autocomplete-suggestions.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.
