types.json
The entity types a release searches, and how each is listed, searched and returned.
types
array of objects
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.
The code of an entity type, such as product, category or a merchant's own store.
A plain value, or a map from locale to value such as { "de": "Farbe", "en": "Color" }.
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.
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" }.
The searched fields in priority order: a word found in an earlier field ranks a hit higher. Default: title, keywords, description. Their order goes live as a setting; which fields are searched needs an index run.
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
Off, a word finds only what holds it as written or starts with it. Default: on.
The fewest letters a word needs to find with one typo. Default: 5.
The fewest letters a word needs to find with two typos; at least one_typo. Default: 9.
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.
The fields a result returns. Default: title, url and image, and for types with offers also price, sale_price, currency and availability.
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
string
The JSON Schema an editor checks this file against; kept as written.
Example
{
"$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