patterns.json

Query patterns that become filters.

patterns

Phrases that, found in a query, become filters. A placeholder captures a number for a numeric attribute, in the attribute's unit, or for a numeric built-in field, price, delivery_days or rating: {width} x {depth} turns "160 x 230" into width 160 and depth 230, and "lieferung in {delivery_days} tagen" read at_most a delivery time. For an option attribute it reads one of the values the attribute lists, by its code, a label or an alias, always exactly: {load_index}{speed_index} turns "91V" and "91 V" into load index 91 and speed index V. A placeholder written against a word or another placeholder may have a space between them, so R{rim} reads "R16" and "R 16".

idstringRequired

An id unique within its file, such as a search test's, an overlay's or a pattern's.

phrasesarray of strings or map of arrays of stringsRequired

The phrases, matched like rule conditions after normalization. A plain list holds in every language.

capturesstring or object

How a captured number filters. Default: exact.

How a captured number filters: "exact", "at_most", "at_least", or { "within": 5 } for a tolerance either way.

4 fields
filterobject

Filters the pattern adds besides its captures, such as { "shape": "round" }.

Picks entities (where). Attribute codes and the built-in fields brand, price, on_sale, availability and delivery_days are keys of the same object; category takes is or within.

{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }

5 fields
categoryobject

The entity is in this category, or below it with within.

A category, exactly or including everything below it.

2 fields
isstring or array of strings

One value, or a list meaning any of them.

withinstring or array of strings

One value, or a list meaning any of them.

anyarray of objectsat least 1 item

At least one of these holds.

allarray of objectsat least 1 item

All of these hold; useful inside any.

This does not hold.

<key>boolean, number, string, array of (boolean, number or string) or object

A plain value (equal), a list (any of them), or an operator object such as { "lt": 20 }.

6 fields
ltboolean, number or string

A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.

lteboolean, number or string

A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.

gtboolean, number or string

A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.

gteboolean, number or string

A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.

betweenarray of (boolean, number or string)2 items

From the first value to the second, both included.

existsboolean

True: the field has a value. False: it has none.

built_in

The built-in patterns, each on unless switched off here.

The built-in patterns a merchant can switch off. Both are on by default.

quantityboolean

A number with a unit, such as "bis 220 cm", filters the one attribute that measures it. Default: on.

priceboolean

A price in the channel's currency, such as "unter 200 €", filters the price. Default: on.

$schema

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

Example

tests/fixtures/home/patterns.json (trimmed)
{
  "$schema": "../../../contracts/schema/patterns.json",
  "patterns": [
    {
      "id": "width-by-depth",
      "description": "A size such as 160 x 230 that is no size value: width and depth within 5 cm",
      "phrases": ["{width}x{depth}", "{width} x {depth}"],
      "captures": { "within": 5 }
    },
    {
      "id": "round-diameter",
      "description": "A diameter such as ø 120 or 120 cm rund: diameter within 5 cm, shape round",
      "phrases": {
        "de": ["ø {diameter}", "ø{diameter}"],
        "en": ["ø {diameter}", "ø{diameter}"]
      },
      "captures": { "within": 5 },
      "filter": { "shape": "round" }
    }
  ]
}

Guide: Patterns

On this page