Evaluating Search — How Do You Know Your Results Are Good?

You changed the ranking function and the results look different — but are they better? Search quality feels subjective, yet the entire field rests on measuring it rigorously, because you cannot improve what you cannot measure. Evaluating search means quantifying relevance with metrics that respect what users actually care about: not just whether the right documents appear, but whether they appear near the top. This post is about measuring relevance honestly, offline and online.

Posts 2–4 built matching and ranking; this post asks whether the ranking is any good. Evaluation is what turns search tuning from guesswork into engineering — and the metrics here (precision, recall, NDCG) are the same ones used to evaluate RAG retrieval, so this is directly load-bearing for modern AI systems too.

Relevance and the two basic measures

Evaluation starts with relevance judgments: for a set of test queries, humans (or usage signals) label which documents are relevant. With those labels, the two foundational metrics (familiar from the ML series’ classification metrics) apply:

They trade off, as always: return everything and recall is perfect but precision terrible; return only your single most confident result and precision may be perfect but recall tiny. For search, though, these raw measures have a critical blind spot that forces something better: they ignore order. Precision and recall treat the result set as a bag — but search is a ranked list, and a relevant document at position 1 is worth vastly more than the same document at position 50 that nobody scrolls to. Measuring search well means measuring rank-awareness, which basic precision/recall don’t.

Rank-aware metrics: position matters

Real search metrics account for where relevant results appear, because users read top-down and rarely go past the first few results:

The unifying idea: good search metrics reward putting more relevant results higher, because that’s what users actually value. Choosing the metric is choosing what you optimize for — MRR if there’s one target answer, NDCG if quality and order across many results matter, precision@k for a simple top-of-page proxy.

Offline test sets vs online reality

Having metrics, you need something to compute them on, and there are two complementary regimes — exactly mirroring the offline/online evaluation split from the LLMOps and ML series:

The disciplined practice combines both: offline metrics for fast, safe, repeatable iteration, and online tests as the ground-truth check before and after shipping — with the crucial caution that offline relevance judgments are a proxy, and a change that improves NDCG on your test set can still hurt real users (Goodhart’s law again). And because these exact metrics (precision, recall, NDCG, MRR) are what’s used to evaluate RAG retrieval quality, learning to measure search is learning to measure the retrieval half of modern AI systems — a bad retriever caps a RAG system’s quality no matter how good the LLM, and these metrics are how you catch it.

The throughline: you can’t improve search you can’t measure, so evaluation quantifies relevance using human judgments. Precision (of returned, how many relevant) and recall (of relevant, how many returned) are the base measures but ignore order — fatal for search, a ranked list where position 1 ≫ position 50. So use rank-aware metrics: precision@k (top-page proxy), MRR (how high is the one right answer), and especially NDCG (graded relevance + positional discounting, normalized — the gold standard), all rewarding more relevant results, higher. Measure them offline (a fixed test collection for fast, safe, repeatable iteration — but judgments are costly, stale, and a proxy) and online (real behavior — CTR, dwell, reformulation — via A/B testing, the ground truth). These are the same metrics that evaluate RAG retrieval, so measuring search is measuring modern AI’s retrieval half.

Key takeaways

Further reading

Sources & References