Create product suggestions configurations

This is for:

Developer

Product suggestions (known as Instant products in Coveo Headless and Coveo Atomic) display products that match the user’s query as they type in the search box. When implemented, end-users can select products straight from the search box.

Product suggestions appearing in the search box as a user types | Coveo for Commerce

You can override the default product suggestions configuration if you want to change its behavior. For example, you might want to change the maximum number of products that are displayed in the suggestions.

A product suggestions configuration applies globally to a specific tracking ID, meaning that all queries made with that tracking ID will use the same product suggestions configuration, regardless of the locale.

Note

Merchandising rules defined in the Coveo Merchandising Hub (CMH) or in the search configuration apply to the product suggestions.

Prerequisites

You must have created a Predictive Query Suggestion model or Query Suggestion model, and have implemented query suggestions in your search box. Refer to the following articles to learn how to implement query suggestions in your search box depending on whether you’re using Headless SSR or CSR:

Create a product suggestions configuration

To create a product suggestions configuration, you must use the Product suggestion configuration endpoint.

Here’s a sample product suggestions configuration JSON:

{
  "trackingId": "<TRACKING ID>", 1
  "queryConfiguration": { 2
    "additionalFields": [
      "color",
      "shirtsize"
    ],
    "perPage": 2
  }
}
1 The tracking ID of the product suggestions configuration. The configuration applies globally to all queries made with that tracking ID, regardless of the locale.
2 The query configuration for the product suggestions. You can specify the following properties:
  • additionalFields: An array of additional fields to return for the products shown in the suggestions.

  • perPage: The maximum number of products to display in the suggestions.