rules.json

The rules in precedence order.

rules

The rules in precedence order: the first rule is the highest.

idstringRequired

A rule's id, unique per release, such as home/out-of-stock-last. It appears in traces, tests, diffs and filter chips, so it is visible to storefronts and holds no secrets.

descriptionstringRequired

One line, up to 200 characters, shown in the panel, the trace and diffs.

enabledboolean

A disabled rule is not evaluated. Default: true.

whenobject

The condition over the request. Without one, the rule always matches.

A predicate over the request (when). Without a condition, a rule always matches.

{ "on": "search", "query": { "contains": ["bremsen", "bremse"] } }

10 fields
queryobject

The query as typed, after normalization. Matching is literal: no typos, synonyms or plurals.

How the query must look. A list of phrases means any of them.

4 fields
isstring or array of strings

One value, or a list meaning any of them.

containsstring or array of strings

One value, or a list meaning any of them.

starts_withstring or array of strings

One value, or a list meaning any of them.

emptyboolean

True: nothing was typed. False: something was.

onstring or array of strings

The surface the request comes from.

3 values

The search page's results.

A category's listing.

A search box's suggestions while the shopper types.

categoryobject

The category page being browsed.

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.

resolvedobject

What the query named. Rules that resolve or rewrite run before resolution and cannot read it.

What the query named: its category, its detected filters, and whether any text is left.

3 fields
categoryobject

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.

filtersobject

The detected filters, as a selector over the detected values.

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.

completeboolean

True when the query resolved completely and no text is left.

channelstring or array of strings

One value, or a list meaning any of them.

localestring or array of strings

One value, or a list meaning any of them.

contextmap of (string or array of strings)

Declared context keys and the values they must have, such as { "customer_group": "b2b" }.

anyarray of objectsat least 1 item
allarray of objectsat least 1 item

A predicate over the request (when). Without a condition, a rule always matches.

{ "on": "search", "query": { "contains": ["bremsen", "bremse"] } }

thenobjectRequired

What the rule does: at least one effect.

What a rule does. Understand-phase effects (resolve, rewrite) run before the query is resolved; redirect ends planning; the rest shape the results, and place puts banners beside them.

10 fields
resolvearray of objects

Decides what an ambiguous term means. Per term, the higher rule decides.

What one term means: values such as { "term": "puma", "as": { "brand": "puma" } }, a category such as "as": { "category": "parts/brakes" }, or "as": "text" to keep it as text.

2 fields
termstringRequired
asstring or map of (boolean, number or string)Required

One of text.

rewriteobject

Removes words from the query before it is resolved and searched. Removals of all rules are united.

1 field
removearray of stringsRequired
redirectobject

Sends the shopper elsewhere. The highest redirect wins and ends planning.

Where a redirect goes: an entity's page, whose URL follows the merchant's catalog, or a fixed URL.

3 fields
tostring

An entity named with its type, type:id, such as product:SOFA-LUND-3.

filtersobject

With a category: the filters chosen on its page, as a request's filters name them.

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.

urlstring

A fixed URL: a path such as /werkstatt, or one that starts with https://.

filterobject

Narrows the results. Shoppers see it as a chip they can remove.

A filter a rule adds, optionally only for one type's section.

2 fields
typestring

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

whereobjectRequired

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.

hidearray of objects

Removes entities from the results. Hide beats pin.

The entities an effect is about: one entity, several, or all that match a selector, optionally of one type.

4 fields
entitystring

An entity named with its type, type:id, such as product:SOFA-LUND-3.

entitiesarray of strings
whereobject

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.

typestring

With where: only entities of this type.

pinarray of objects

Puts entities at fixed positions, within every filter.

3 fields
entitystringRequired

An entity named with its type, type:id, such as product:SOFA-LUND-3.

positionintegerRequired

The slot, counted from 1. Positions are unique within a rule; on a tie between rules the higher one takes the slot and the other moves to the next free one.

sponsoredobject

A paid placement: the hit names its campaign, so a storefront marks it as an ad and reports its views and clicks for the campaign. It is placed as any pin is, only where the product meets the page's category and filters.

The campaign a paid placement belongs to: { "campaign": "Michelin spring" }.

1 field
campaignstringRequired

The merchant's name for it, which the campaign report counts by.

boostarray of objects

Moves entities up, within relevance.

A boost or bury.

5 fields
entitystring

An entity named with its type, type:id, such as product:SOFA-LUND-3.

entitiesarray of strings
whereobject

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.

typestring

With where: only entities of this type.

strengthstringRequired

One of slight, medium or strong.

buryarray of objects

Moves entities down, within relevance.

A boost or bury.

5 fields
entitystring

An entity named with its type, type:id, such as product:SOFA-LUND-3.

entitiesarray of strings
whereobject

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.

typestring

With where: only entities of this type.

strengthstringRequired

One of slight, medium or strong.

sectionsarray of strings

The order of sections. Types not listed follow in the release's order.

placearray of objects

Puts banners and teasers above, among or below the results. A placement is not a hit: it changes no total, facet, page size or order of hits.

A banner at a place of the page: { "slot": "top", "banner": { ... } }, or among the tiles, { "slot": "grid", "position": 5, "banner": { ... } }.

3 fields
slotstringRequired

Where on a page a banner sits.

3 values

Above the results, on the first page. Banners of several rules stand in rule order, the highest first.

Among the tiles, before the one at its position, on the page that holds that tile.

After the results, on the last page. Banners of several rules stand in rule order, the highest first.

positionintegerat least 1

With grid, and only there: the tile it sits before, counted from 1 across the pages of the listed section, whose tiles are the page's products, or its services on a workshop's page. Positions are unique within a rule; on a tie between rules the higher one takes the position and the other moves to the next free one, as pins do. A position past the last tile the pages reach shows nowhere, and the trace says why.

bannerobjectRequired

What a placement shows: a campaign's banner or a teaser to a page, with its words in every locale the release serves.

5 fields
kindstringRequired
2 values

A campaign's banner, as wide as the results.

A card to a page, such as a buying guide, the size of a tile.

titlestring or map of stringsRequired

The headline, up to 200 characters.

textstring or map of strings

A line or two under the title.

imageobject

A banner's image and the words that stand for it.

2 fields
urlstringRequired

A path such as /media/summer.jpg, or a URL that starts with https://.

altstring or map of stringsRequired

What the image shows, for a shopper who cannot see it.

scheduleobject

When the rule is active, checked against the time in the request, never the engine's clock.

A window in time: from from (inclusive) until until (exclusive). Either end may be open.

2 fields
fromstring

A point in time as RFC 3339 with an offset, such as 2026-11-27T00:00:00+01:00.

untilstring

A point in time as RFC 3339 with an offset, such as 2026-11-27T00:00:00+01:00.

originobject

Where the rule came from. Without it, the merchant made it.

Where an imported rule or overlay came from.

2 fields
importstringRequired

What it was imported from, such as the previous search's export.

refstringRequired

$schema

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

Example

tests/fixtures/home/rules.json (trimmed)
{
  "$schema": "../../../contracts/schema/rules.json",
  "rules": [
    {
      "id": "home/sofa-sale",
      "description": "Sofa sale on top of the sofas, armchairs among them",
      "when": { "category": { "is": "wohnen/sofas" } },
      "then": {
        "place": [
          {
            "slot": "top",
            "banner": {
              "kind": "banner",
              "title": { "de": "Sofas im Angebot", "en": "Sofas on sale" },
              "text": {
                "de": "Samt, Leder und Stoff: ausgewählte Sofas jetzt reduziert.",
                "en": "Velvet, leather and fabric: selected sofas, now reduced."
              },
              "image": {
                "url": "/demo/images/81dwblf8ogL.jpg",
                "alt": {
                  "de": "Grünes Samtsofa mit goldenen Beinen",
                  "en": "Green velvet sofa with gold legs"
                }
              },
              "link": {
                "to": "category:wohnen/sofas",
                "filters": { "on_sale": true }
              }
            }
          }
        ]
      }
    }
  ]
}

Guide: Rules · Banners and teasers

On this page