Commerce fields

Commerce fields hold key information about each item in your index. They contain metadata, such as the product name or price, that power your product discovery experiences with Coveo.

You can use these commerce fields to:

When preparing your catalog data for indexing, one of the first steps is to configure these fields.

This article explains which fields are required, recommended, and optional to set up in your Coveo for Commerce organization.

Tip

The resource snapshots feature lets you copy configurations from one Coveo for Commerce organization to another, such as when you migrate from a sandbox to a production organization. It only copies the source configuration, not the source content.

Use this feature to reuse your catalog entities and their catalog configurations, your Catalog sources, and your fields and field mappings.

Standard commerce fields

The standard commerce fields ensure that:

When you create a Catalog source in your Coveo organization, the standard commerce fields are automatically generated and can’t be changed. With other source types, you must create these fields yourself.

Make sure to create mappings for these fields. You must also map the unique product identifier to the permanentid field.

Note

To train Coveo ML models, you can’t use the # character in the ec_product_id or permanentid fields.

The following table lists the standard commerce fields and their properties:

Field Type Description Usage notes

ec_name[1]
(Required)

String

The product’s name.

  • Displays the product’s name in the result template.

  • Enabled field settings:

ec_description[1]
(Required)

String

The product’s description.

ec_product_id[2]
(Required)

String

The product’s unique identifier within a single source.

ec_category
(Required)

String

The product’s category.

ec_price
(Required)

Decimal

The product’s base price.

  • Displays the product’s price in the result template.

  • Enabled field settings:

ec_item_group_id
(Required for grouping)

String

An identifier used to group similar products together.

  • Enforces grouping of products in search results and product listing pages.

  • Useful in reports.

  • Used by ML models.

  • Enable the required settings if you want pagination, facet counts, and result counts to reflect the number of groups rather than individual items.

ec_thumbnails
(Recommended)

String

A collection of lower resolution product images used for faster page load time (URL format).

  • Used in the result template to show the main product image.

ec_images
(Recommended)

String

A collection of high-resolution product images used to view product details (URL format).

  • Shows product images in the result template when high quality images are required.

ec_in_stock
(Recommended)

String

Boolean indicating whether the product is in stock. Valid values are true or false.

  • Indicates whether the product is in stock in the result template.

  • The string value must be either true or false.

  • Enabled field settings:

ec_shortdesc
(Recommended)

String

A short description of the product.

  • Displays the product’s short description in the result template.

ec_brand
(Recommended)

String

The product’s brand.

ec_promo_price
(Recommended)

Decimal

The product’s promotional price.

  • Displays the product’s promotional price in the result template.

  • Enabled field settings:

ec_cogs
(Recommended)

Decimal

Used to calculate the product margin.

  • Can be used to promote products with a higher margin.

ec_rating
(Recommended)

Decimal

A rating-based system from 0-10.

  • Displays the product’s rating in the result template.

  • Enabled field settings:

1. To improve keyword relevance, Name and Description will be copied to Title and Body respectively by the default Catalog source mappings.

2. Set ec_product_id as your unique product ID field when creating your catalog configuration.

3. facet fields can be used to generate product listing pages (PLPs).

Important

Avoid modifying the metadata of standard commerce fields using an indexing pipeline extension (IPE). This action can make the data unusable for internal systems, such as Coveo Personalization-as-you-go models.

Structure fields

In addition to the standard commerce fields, structure fields are required for setting up your catalog configuration.

When you create a Catalog source, the catalog structure fields are automatically created in your organization. With other source types, you must add these fields yourself.

Make sure to create source mappings for these fields. If you’re using a Catalog source, these source mappings are automatically created. For example, the ec_availability_id field is automatically created and mapped to the ec_availability_id metadata key.

The following table lists the catalog structure fields and their properties:

Field Description Field setting options to enable Example

objecttype
(String)

Identifies the item's catalog object (product, variant, or availability).

Availability

ec_variant_id
(String)

Uniquely identifies each sellable variant in a catalog entity with variants.

887056_35F_24

ec_availability_id
(String)

Uniquely identifies each availability channel.

s000002

ec_available_items
(String)

Identifies the list of available products and variants in a given availability channel.

["887056_35F_24", "887056_35F_25", "887056_35F_26", "887056_35F_36", "887056_35F_38"]

Note

If your catalog entity contains products without variants, or if the products are offered through a single availability channel (for example, a single store or product list), you won’t need to configure all of the fields listed in this section.

Create additional commerce fields

You can also add your own fields to provide users with additional information about your products. These additional fields also let users target their desired content.

You can create your fields manually through the Administration Console (platform-ca | platform-eu | platform-au), or programmatically through the Fields API. Fields are also used as attributes to build rules in the Coveo Merchandising Hub (CMH). If you want to use a given field as an attribute in rules, you must enable the Facet or Multi-value facet option for that field.

Tip
  • You’ll want to explore your metadata before you create your fields.

  • Ensure that your field has the same exact name as the product metadata indexed in your source.

If you don’t use ec_product_id as your unique product identifier, you must create a field that matches the name of your metadata key. You must also map your unique product identifier to the permanentid field.

The mapping of your metadata has to be done through the source mappings. See Additional fields mapping for instructions on how to map your additional fields to your metadata.

Tip
Leading practice

In your catalog content, avoid using the same field name that you intend to use as facets, on different types of items. For example, if you’re defining the color at a product level, then you shouldn’t define the color at the variant level. If you must include a field at both levels, prefix it with product and variant (e.g, productcolor, variantcolor) so that they’re different in the index.

Fields per objecttype

The fields defined in this article will be used for different object types in your source.

Field Product Variant Availability

ec_name

check

check

check

ec_product_id

check

check

ec_description

check

permanentid

check

check

check

ec_category

check

ec_item_group_id

check

ec_price

check

objecttype

check

check

check

documentid

check

check

check

ec_variant_id

check

ec_availability_id

check

ec_available_items

check

latitude

check

longitude

check

Payload example

When sending your catalog data for indexing, ensure that the required standard commerce and structure fields are included in your payload. You’ll also want to include any recommended or optional fields that are relevant to your products, variants, or availabilities.

The following JSON snippet shows an example of products with variants and availabilities, including the required standard commerce and structure fields, as well as some recommended fields and additional custom fields:

{
  "addOrUpdate": [ 1
    {
      "documentId": "product://SP01020_002", 2
      "ec_name": "Okeanos Kayak",
      "ec_description": "This sea kayak is perfect for beginner and experienced kayakers. It's lightweight, easy to assemble, and comfortable to use.",
      "ec_product_id": "SP01020_00002",
      "ec_category": "Canoes & Kayaks ; Canoes & Kayaks|Kayaks ; Canoes & Kayaks|Kayaks|Sea Kayaks",
      "ec_price": "2200.00",
      "ec_item_group_id": "SP01020",
      "ec_thumbnails": "https://images.barca.group/...",
      "ec_images": "https://images.barca.group/...",
      "ec_in_stock": true,
      "ec_shortdesc": "This sea kayak is perfect for beginner and experienced kayakers.",
      "ec_brand": "Barca Sports",
      "ec_promo_price": 2200.00,
      "ec_cogs": 0.54,
      "ec_rating": 3,
      "objecttype": "Product",
      "number_of_seats": 1,
      "material": "Polyethylene",
      "water_type": "Calm",
      "kayak_type": "Recreational",
      "kayak_size": "10 ft"
    },
    {
      "documentId": "variant://SP01020_002_blue", 3
      "ec_name": "Okeanos Kayak - Blue",
      "ec_product_id": "SP01020_00002",
      "ec_variant_id": "SP01020_0002_blue",
      "objecttype": "Variant",
      "color": "Blue"
    },
    {
      "documentId": "availability://s000001", 4
      "ec_name": "New York Store",
      "ec_availability_id": "s000001",
      "ec_available_items": [
        "SP01020_0002_blue",
        "SP01020_0002_red",
        // ...
      ],
      "objecttype": "Availability",
      "latitude": 40.71427,
      "longitude": -74.00597
    },
    // ...
  ]
}
1 The addOrUpdate operation contains an array of items to be indexed through a Stream API request.
2 A product item, containing:
Required standard and structure fields Optional standard fields Custom fields
  • documentid

  • ec_name

  • ec_product_id

  • ec_description

  • ec_category

  • ec_price

  • ec_item_group_id

  • objecttype

  • ec_thumbnails

  • ec_images

  • ec_in_stock

  • ec_shortdesc

  • ec_brand

  • ec_promo_price

  • ec_cogs

  • ec_rating

  • number_of_seats

  • material

  • water_type

  • kayak_type

  • kayak_size

3 A variant item, containing:
Required standard and structure fields Optional standard fields Custom fields
  • documentid

  • ec_name

  • ec_product_id

  • ec_variant_id

  • objecttype

  • color

4 An availability item, containing:
Required standard and structure fields Optional standard fields Custom fields
  • documentid

  • ec_name

  • ec_availability_id

  • ec_available_items

  • objecttype

  • latitude

  • longitude

What’s next?

Once you’ve ensured that all the required fields exist in your organization, you must define proper mappings between your product metadata and your fields.

See Map commerce fields for more information.