Skip to content

SKUs

A SKU is a specific variant of a product. A SKU might have its color or price, but otherwise inherits all the fields from its product.

SKU fields

Attributes

Attributes are a central part of distinguishing different SKUs from each other, but also different products from each other. Attributes can be a list of terms, a number, or an interval. Typical examples include Color, Height, and Size.

Any property that would make sense for a user to filter on should be created as an attribute. Since attributes can be created as domain filters, it is also a good idea to model instock as an attribute. Attributes can also be assigned search relevance, so that a match with the text in the attribute has the specified weight.

It is better to add the data as metadata if it is not going to be used for facets, domain filters, or to be searchable.

Note

Attributes and metadata can cause field name conflicts. See field name priority for more information.

String attributes

String attributes are defined by a key and a list of term values, each with an ID and a name. This is useful if you have multiple languages but want to maintain some consistency between them.

Example of string attribute:

1
2
3
4
5
6
7
8
"sizes": {
  "name": "Standard Sizes",
  "values": {
    "s": "Small",
    "m": "Medium",
    "l": "Large"
  }
}

Bizzkit recommends

String attributes can be configured as searchable.

Therefore, we recommend that string attribute terms be written in the language your customers are familiar with, rather than using acronyms or internal shorthand.

  • Instead of mapping sizes to S, M, L, use the term they represent Small, Medium, Large.

By speaking the customer's language, your customers get a better search experience.

Number attributes

Number attributes contain a list of numbers of type double. For example Size: [ 42.0 ]. Number attributes are not searchable, but can still be used as facets or domain filters.

Interval attributes

Number attributes contain two numbers. For example AcceptedVoltage: { min: 120, max: 230 }. Interval attributes are not searchable, but can still be used as facets or domain filters.

Metadata

Metadata exists on both the product and the SKU. If the value is the same for all SKUs, the data should be added to the product, otherwise it should be added to the SKU. Read more about metadata here.

Stock

Stock is an integer specifying the number of items in stock. The stock value of a SKU can change quite often, but updating Ecommerce Search all the time with stock information is not advised. It is better to use Stock as either a boolean value, denoting whether or not the SKU is in stock. Alternatively, stock can be modeled as a string attribute. This enables the use of different values in stock, that do not change as often, such as Stock: [ "few" ] or Stock: [ "plenty" ].

Note

If Stock is left empty, it will default to 0.

Prices

A SKU can be part of multiple price groups. This allows a product to have different prices for different customers or at different times. A price consists of a PriceGroupId, ListPrice, and Price. The PriceGroupId is then provided in a search request, to retrieve the correct price of the SKU. A price group has an actual price and a listed price.

The price is given as an integer, representing the lowest unit of the currency, i.e. Cents in Euro, Øre in DKK etc.

There is no fallback for price groups, so a price group must have a price for all SKUs that is available to the user.

The default price group used when searching is "default", so be sure to always include this one if prices are to be used.

Prices are not required.

Commercial parameters

Commercial parameters are used to affect the order in which the product is shown.

Commercial affinities

Commercial affinities are used in conjunction with User affinities to boost the product based on personalization.