Searchable Feature gallery

ADR-0003: BM25F with configurable field/doc/term boosts as the ranking model

Status

Accepted (implemented since Phase 1/2, packages/client/src/score.ts).

Context

The browser search described in the overview needs a concrete ranking model that supports multi-field documents (title vs. body should not weigh equally), per-query and per-document tuning, and stays computable client-side without a corpus-wide index scan per query.

Decision

BM25F (guides/ranking-and-boosts.md): per-field term frequency combined with field weights before the BM25 saturation function is applied, rather than scoring each field with plain BM25 and summing — the mathematically correct way to combine multi-field relevance rather than an ad-hoc weighted sum of independent scores. Layered on top: configurable field boosts (build-time default, per-query override), a per-query term boost, and a per-document searchable-boost multiplier applied last. Corpus-wide statistics (docCount, avgFieldLength) are computed per language, since mixing two languages' statistics into one number would skew idf and length normalization for both.

Alternatives Considered

Consequences