
Relevance Tuning for Site Search
What a relevance score is made of, why field weights reach every query that touches a field, how business boosts stay governed, and the before/after evidence rule for every change.
TL;DR: Relevance tuning is the craft of owning why result three ranks above result four — and it is easy to slide into doing it by superstition, adjusting settings after a complaint and hoping nothing else broke. This article gives you the working model of what a relevance score is made of, the main levers — field weights, document signals, and business boosts — and the discipline that makes tuning safe: every relevance change ships with before/after evidence, because the site-wide levers move every query that touches them.
What the score is made of
Engineers who treat the relevance score as a black box tune by folklore: a boost here, a magic number there, each added under deadline with no record of why. The antidote is a working model, and it takes one paragraph, not a mathematics course.
A document's score combines three ingredients. The first is match quality: how well the query's terms matched — whether rare, discriminating terms matched (a match on "titanium" says more than a match on "the"), whether all the terms matched or only some, and whether they matched near each other as a phrase. The second is field importance: where the match happened — the same term matching in a title is stronger evidence of relevance than matching in passing body prose. The third is document signals: what the document is, independent of this query — its popularity, its recency, whether it is in stock.
For the match-quality ingredient, Elasticsearch and OpenSearch score text with the BM25 ranking function by default, as Elasticsearch's similarity settings and OpenSearch's text field reference document; other engines document their own approach — Meilisearch applies an ordered list of ranking rules, Algolia applies eight tie-breaking ranking criteria, Typesense ranks with a tie-breaking sort on its own text match score, and PostgreSQL offers the ts_rank and ts_rank_cd functions (as of November 2026). For BM25, the intuition is all a search owner needs: rarer terms count more, repeated occurrences of a term hit diminishing returns, and matches in shorter fields count denser than matches in long ones. The formula's internals are the engine's job.
One prerequisite frames everything that follows: ranking can only read what the index carries. Clean match fields, normalized attributes, and stored popularity signals are the index-design article's work. A tuning session that keeps discovering missing or dirty fields has found index work, not ranking work.
Field weights: a lever with a wide reach
A high-leverage relevance decision is how much each match field counts, and the canonical hierarchy exists for a reason. A product's title is its chosen name — words someone deliberately selected to identify the thing. Body prose mentions words in passing. A match in the title is therefore stronger evidence than the same match in the description, and attribute and category fields sit between the two: more deliberate than prose, less identifying than the name. How much leverage field weights carry depends on the engine's scoring mode: in Typesense's default max_score mode, for example, field weights are used only as a tie-breaker when two documents share the same text match score, while its sum_score mode sums the field-level weighted text match scores (as of November 2026).
Exactness belongs in the same hierarchy, as deliberate design: an exact phrase match ranks above all-terms-present, which ranks above partial matches — and matches that only succeeded through typo tolerance rank below the untolerated ones. The tolerance mechanics live in their own article; the rank position of tolerant matches is decided here, and the rule is that forgiveness must never outrank exactness.
A worked judgment makes the hierarchy concrete. A visitor searches for "insulated travel mug". Product A carries all three words in its title. Product B has "travel mug" in the title and "insulated" only in the description, alongside a paragraph that happens to mention travel twice. The default hierarchy puts A first, and that is the right call here — A's own name claims all three words. When a domain inverts this, one cause is that titles are uninformative (auto-generated codes, uniform naming) and the real signal lives in attributes — which is, again, an index observation worth fixing at the source rather than compensating for in weights.
The property that makes weights dangerous is their reach: whether they live in index settings (the searchableAttributes order in Meilisearch and Algolia) or in a query configuration sent with each search (Typesense's query_by_weights), a weight applies to every query that uses that setting (as of November 2026). A title boost added to fix one complaint moves every query that touches titles — many result orderings shift, and the ones that break are the ones nobody was watching. This blast radius is the reason the discipline section below is not optional.
| Lever | What it moves | Blast radius | Failure mode |
|---|---|---|---|
| Field weights | Every query touching the field | Site-wide | Fixing one loud query, breaking several quiet ones |
| Exactness tiers | Ordering among match types | Site-wide | Fuzzy matches outranking exact ones |
| Document signals | Tie-breaks and modest lifts | Broad but bounded | Popularity burying the long tail |
| Business rules and pins | Named queries or categories | Narrow but unaudited | Rule rot — boosts nobody remembers |
Document signals and business boosts
Document signals earn their place as tie-breakers and modest multipliers, never as primary rank. Popularity, recency, and availability are real information: between two documents that match equally well, the one people actually engage with — and that is actually in stock — deserves the higher slot. The failure mode is letting the signal dominate: a popularity-first ranking buries the long tail, turns yesterday's bestsellers into a self-reinforcing loop, and answers the query the user did not ask. A popular irrelevant document is still irrelevant.
Business rules are the second, sharper instrument: a pinned result for a named query, a boosted category during a season, a promoted line the business wants seen. These are legitimate merchandising mechanics, and the engineering obligation is governance, because rules accumulate. Each rule deserves three attached facts: an owner, a rationale, and an expiry. A ranking layered with anonymous, expired, undocumented boosts becomes a system nobody can explain — and the discovery moment can be someone asking why a discontinued product still tops a head query. That is rule rot, and expiry dates are the vaccine.
Two boundaries keep this section honest. Which items deserve promotion is a merchandising decision above this article — what lives here is the mechanism and its governance. And ranking personalized to an individual visitor's profile sits on the customer-data layer, with governance needs of its own and, where privacy laws apply to the business and the data, legal obligations; the signals in this article stay at the level of aggregate behavior and document properties.
The overfitting trap
The recurring failure pattern in relevance work deserves its own name, because it is easy to fall into. An executive searches for something, dislikes the third result, and files the complaint. An engineer adds a weight or a rule that fixes that query. Other queries quietly degrade — and nobody re-checked them, because nobody was complaining. Repeat this over enough cycles, and the configuration becomes an archaeology of past complaints, each layer fixing the last layer's damage.
Tuning to the loudest complaint is an anti-pattern, and the counter-discipline is mechanical: a golden set of representative queries, checked before and after every change. Building and running that set — the sourcing, the graded judgments, the CI wiring — is the evaluation article's territory. What is decided here is the standing rule: no relevance change ships without before/after evidence. Not weight changes, not new rules, not synonym additions, because a synonym is a relevance change wearing a different hat.
The supporting practice is treating relevance configuration as code. Weights, rules, and their interactions live in versioned, reviewable configuration with a change log — because "who changed the ranking, when, and why" is a question someone will eventually ask, and "nobody knows" is an answer that can force a rebuild.
One honesty for smaller sites: on a small corpus, aggressive weight tuning can end up reshuffling already-adequate results. If the top results are right and the complaints are about missing matches rather than misordered ones, the effort belongs in index enrichment and synonyms, not in ranking. Part of owning the surface is knowing which lever the evidence actually points at.
What tuning cannot fix
Relevance work has clean edges, and recognizing them saves long stretches of misdirected effort.
Tuning cannot fix missing or dirty data. No weight configuration compensates for absent attributes, inconsistent naming, or thin content — that work returns to the index-design article's enrichment honesty, with a data owner attached.
Tuning cannot fix vocabulary mismatch. When users ask in words the corpus never uses — the symptom instead of the product, the colloquial name instead of the catalog name — heavier weights on fields that do not contain those words move nothing. The fixes live elsewhere: the synonym dictionary for the mappings a team can curate, and hybrid semantic retrieval when the mismatch class outgrows curation. Both have their own articles.
Tuning cannot see zero-result queries at all. Ranking orders candidates; when retrieval returns none, there is nothing to order. The zero-results recovery path is its own designed subsystem, and its logs — which the analytics article turns into a standing review — are one of the richest inputs relevance work receives.
Which is the closing frame: relevance is never done. Catalogs drift, query language shifts with seasons and trends, and last year's defensible weights meet this year's different corpus. A tuned system stays tuned more easily when it is wired into a loop — telemetry showing what users experienced, a golden set proving what a change did, and a change log recording why. Build the loop once, and tuning stops being superstition.