ranking.json

Signals and weights, boost and bury strengths, sort options and section order.

signals

How each signal is read before it is weighted.

A signal and how it is normalized into the business score.

codestringRequired

The code of a signal, such as sales_30d or rating.

directionstringRequired
3 values

For dates: the more recent, the better.

normalize"percentile" or objectRequired

How a signal becomes a number between 0 and 1.

2 fields
dampedobject

An average pulled towards the mean while few votes back it, such as a rating with few reviews.

2 fields
count_signalstringRequired

The signal that counts the votes, such as rating_count. It is read from the catalog and needs no definition of its own.

prior_countintegerRequired

How many votes count as much as the mean.

Halves its effect every this many days; for dates.

weights

Per type, the weight of each signal in the business score. A weight change needs an index run.

strengths

The multipliers behind the strengths slight, medium and strong.

The multipliers of each strength. Boosts above 1, buries below.

boostobjectRequired
3 fields
slightnumberRequired
mediumnumberRequired
strongnumberRequired
buryobjectRequired
3 fields
slightnumberRequired
mediumnumberRequired
strongnumberRequired

sorts

The sort options pages may offer besides relevance.

A sort option, such as price_asc over price.

codestringRequired

The code of a sort option, such as price_asc. relevance is built in.

labelstring or map of strings

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

bystringRequired

price, delivery_days, discount (the reduction a sale gives, in percent of the regular price), a sortable attributes.<code>, or signals.<code> of a defined signal.

directionstringRequired

One of asc or desc.

sections

The order of sections in mixed results. Types not listed follow in the order of types.json.

$schema

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

Example

tests/fixtures/home/ranking.json (trimmed)
{
  "$schema": "../../../contracts/schema/ranking.json",
  "signals": [
    {
      "code": "sales_30d",
      "direction": "higher_is_better",
      "normalize": "percentile"
    }
  ],
  "weights": { "product": { "rating": 0.3, "released_at": 0.2, "sales_30d": 0.5 } },
  "sorts": [
    {
      "code": "price_asc",
      "label": { "de": "Preis aufsteigend", "en": "Price: low to high" },
      "by": "price",
      "direction": "asc"
    }
  ],
  "sections": ["category"]
}

Guide: Ranking

On this page