- Product Variant records: create one record per product variant.
- Product records: create one record per base product, containing all the variants in a
variants
attribute.
Variant level schema
Algolia stores commercetools product variants in the following format:JavaScript
Product level schema
JavaScript
attributes
field lists all the commercetools product attributes.
Attributes used for search
By default, users can search in the following attributes, ranked in order of importance:name
description
searchableAttributes
. All commercetools product attributes where theisSearchable
property istrue
. It’s a subset of theattributes
object in the product schema.categories
Configure results grouping
Results are grouped by default when you use the product-level schema. In a variant-level schema, large catalogs often group related variants to show one result per base product. To enable this, set thedistinct
feature
and use productID
as the attributeForDistinct
.
Categories
Categories are stored as hierarchical facets. Category pages are automatically generated and referenced by thecategoryPageId
attribute.
The categoryKeys
attribute is a flattened version of the categories
attribute hierarchy.
Changes to your commercetools inventory
Algolia’s commercetools integration monitors inventory changes and sets theisInStock
value for each affected SKU.
isInStock
is true
if the inventory for any supply channel is greater than zero for that SKU.
Prices
Theprices
attribute consists of key-value pairs with currency codes as keys, such as “USD”.
Values contain:
-
The minimum price
min
incentAmount
: the smallest unit of the currency such as cents, pence, or centime. -
The maximum price
max
incentAmount
-
A list of all the Customer Groups set in the prices as
customerGroups
with the following properties:id
. The ID of the Customer Group.price
. The price of the Customer Group incentAmount
.
-
A list of values for each price as
priceValues
with the following properties:id
. The ID of the price.value
. The price incentAmount
.discountedValue
. The discounted price incentAmount
.validFrom
. The date from which the price is valid.validUntil
. The date until which the price is valid.customerGroupID
. The ID of the customer group to which the price applies.