types.json

The entity types a release searches, and how each is listed, searched and returned.

types

The types this release searches. Built-in types are product, service, category, content and brand; any other code defines a type of the merchant's own.

An entity type: its capabilities, what one result tile represents, and which fields are searched and returned.

typestringRequired

The code of an entity type, such as product, category or a merchant's own store.

labelstring or map of strings

A plain value, or a map from locale to value such as { "de": "Farbe", "en": "Color" }.

capabilitiesarray of strings

What the type can do. Built-in types have fixed capabilities and leave this out: product has variants and offers, service has offers, category has tree, content and brand have none.

3 values

One level of buyable variations.

Price and availability per channel.

A place in a tree with one parent.

listingstring or object

What one result tile represents. Default: one tile per product.

What one result tile represents: "product", "variant", or one tile per value of an axis, { "axis": "color" }.

3 fields
axisstring

The code of an attribute definition, such as color or seat_height. The reserved words any, all, not, category, brand, price, on_sale, availability, delivery_days and rating cannot be attribute codes.

typosobject

Whether, and from how many letters on, a word finds what holds it with a typo. Default: on, one typo from 5 letters, two from 9. It goes live as a setting.

How a type's words forgive typos. A typo is a letter added, left out, changed, or two neighbours swapped; one at the first letter counts as two.

3 fields
enabledbooleanDefault true

Off, a word finds only what holds it as written or starts with it. Default: on.

one_typointegerDefault 5

The fewest letters a word needs to find with one typo. Default: 5.

two_typosintegerDefault 9

The fewest letters a word needs to find with two typos; at least one_typo. Default: 9.

no_typosarray of strings

Searched attributes whose words are found only as written or by their start, never with a typo, such as part numbers: one character off names another part. Default: derived by every run, the identifier attributes the type searches whose values nearly always belong to one product alone; [] exempts none. A change needs an index run, since the engine reads every document again for it.

resultarray of strings

The fields a result returns. Default: title, url and image, and for types with offers also price, sale_price, currency and availability.

detailsarray of strings

The attributes a product lookup lists as the product's and its variants' details, in order, such as ["material", "width", "height"]. Default: every attribute, in the order of attributes.json.

$schema

The JSON Schema an editor checks this file against; kept as written.

Example

tests/fixtures/home/types.json (trimmed)
{
  "$schema": "../../../contracts/schema/types.json",
  "types": [
    {
      "type": "product",
      "label": { "de": "Produkt", "en": "Product" },
      "search": ["title", "brand"],
      "result": ["title", "url"],
      "details": ["color", "size"]
    },
    {
      "type": "category",
      "label": { "de": "Kategorie", "en": "Category" },
      "search": ["title", "keywords"],
      "result": ["title", "url"]
    }
  ]
}

Guide: Types and attributes · Fields and typos

On this page