> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Suggestions

> Enable Algolia Query Suggestions in the Autocomplete menu.

Search suggestions in the Autocomplete menu can come from [Algolia Query Suggestions](/doc/guides/building-search-ui/ui-and-ux-patterns/query-suggestions/js) (this is recommended), from Adobe Commerce and Magento Open Source Search Queries, or you can turn them off entirely.

## Use Algolia Query Suggestions

<Steps>
  <Step title="Create an Algolia Query Suggestions index">
    1. Go to the [Algolia dashboard](https://dashboard.algolia.com/dashboard/).

    2. Click **Query Suggestions**

    3. Click **New Query Suggestions**

           <img src="https://mintcdn.com/algolia/3NF4Hg7jI_C2HRpc/doc/integration/magento-2/how-it-works/query_suggestions_form.png?fit=max&auto=format&n=3NF4Hg7jI_C2HRpc&q=85&s=ff64b9c59009ea7b5077828209ef8215" alt="Query Suggestions form" width="1600" height="1182" data-path="doc/integration/magento-2/how-it-works/query_suggestions_form.png" />

    4. Choose an index name (this guide uses `query_suggestions_test`).

    5. Select the different languages you're using and the source index (for example, your main product index).

    6. Click **Accept and Continue** to create the Query Suggestions index.

    When the index is ready,
    it appears in the [Algolia dashboard](https://dashboard.algolia.com/explorer).

    <img src="https://mintcdn.com/algolia/3NF4Hg7jI_C2HRpc/doc/integration/magento-2/how-it-works/query_suggestions_index.png?fit=max&auto=format&n=3NF4Hg7jI_C2HRpc&q=85&s=0cf65df5125b0a451f65d2256cf222d2" alt="Query Suggestions index" width="2030" height="1340" data-path="doc/integration/magento-2/how-it-works/query_suggestions_index.png" />
  </Step>

  <Step title="Enable Algolia Query Suggestions">
    1. Go to **Stores > Algolia Search > Autocomplete Menu > Enable Suggestions** in your Magento store's Admin.
    2. Select **Use Algolia Query Suggestions**.

           <img src="https://mintcdn.com/algolia/i83yUQGTgUJx5C3m/doc/integration/magento-2/how-it-works/algolia-query-suggestions.png?fit=max&auto=format&n=i83yUQGTgUJx5C3m&q=85&s=302f5cfba2365c229b0e0b89f1767b49" alt="Magento Admin Autocomplete settings" width="2316" height="604" data-path="doc/integration/magento-2/how-it-works/algolia-query-suggestions.png" />

       * **Search suggestions index name**: specify the index name you have configured in Algolia to use for Query Suggestions
       * **Number of Algolia Suggestions**: 3 by default
  </Step>

  <Step title="Clear the cache and test the search">
    Test the search box to confirm that suggestions appear.
  </Step>
</Steps>

## Use Magento search queries

When Magento Search Queries are enabled, the extension indexes search terms from Adobe Commerce and Magento Open Source
and displays them in the [Autocomplete menu](/doc/integration/magento-2/customize/autocomplete-menu).

To enable Magento Search Queries,
go to **Stores > Algolia Search > Autocomplete Menu > Enable Suggestions** in your Magento Admin
and select **Use Magento Search Queries**.

<img src="https://mintcdn.com/algolia/i83yUQGTgUJx5C3m/doc/integration/magento-2/how-it-works/magento-query-suggestions.png?fit=max&auto=format&n=i83yUQGTgUJx5C3m&q=85&s=9fbf0687e0efd8acb175706916a6bec0" alt="Magento Admin Autocomplete settings" width="2318" height="700" data-path="doc/integration/magento-2/how-it-works/magento-query-suggestions.png" />

* **Number of queries**: 0 by default. The maximum number of results shown in the Autocomplete menu
* **Minimum query popularity**: 1,000 by default
* **Minimum number of results per query**: 2 by default

### Clear the cache and reindex suggestions

<CodeGroup>
  ```sh Extension version 3.16 and higher theme={"system"}
  php bin/magento algolia:reindex:suggestions
  ```

  ```sh Extension version 3.15.x and lower theme={"system"}
  php bin/magento indexer:reindex algolia_suggestions
  ```
</CodeGroup>

Test the search box to confirm that suggestions appear.
