Search, ranking & recommendation
How a ranked list is built, measured and defended — the evaluation mathematics, the tuning loop and the product decisions that sit on top of whatever retrieval engine you chose.
Search looks like a solved problem from the outside and is not, because the hard part was never retrieval. Retrieval is a well-understood engineering job with good open-source answers. The hard part is deciding which of two orderings is better, proving it with enough confidence to ship, and doing that repeatedly without the metric you optimise quietly drifting away from the thing you care about.
So these pages are mostly about measurement and judgement. Where an equation decides something — the logarithmic discount in nDCG, the saturation term in BM25, the examination probability that makes raw click-through rate uninterpretable, the variance reduction that makes a paired experiment sensitive — the equation is written out, its terms defined, and one example worked by hand with the inputs labelled as assumptions. Substitute your own and the conclusion moves with them.
Embeddings, vector indexes and cross-encoder rerankers are covered in the embeddings cluster and the RAG cluster. This one assumes you have them and asks whether the list they produce is any good.
How Modern Search Works: Retrieve, Rank, Rerank
The three-stage cascade every large search system converges on, why the arithmetic forces it, and the recall ceiling that stage one silently imposes on everything downstream.
6 min read
Relevance Tuning: Making Search Feel Right
The judgement list, the BM25 parameters worth touching, and the sample-size arithmetic that tells you whether a tuning change is real or noise.
6 min read
Measuring Search Quality: nDCG, MRR and Click Metrics
nDCG, MRR and MAP computed by hand on one ranking, and the examination model that explains why a raw click-through rate cannot be compared between positions.
7 min read
Query Understanding: Intent, Entities and Spelling
The stages that run before a single document is retrieved — normalisation, correction, segmentation, entity extraction, intent — and the noisy-channel arithmetic behind spelling correction.
6 min read
Faceted Search and Filters That Don’t Return Zero Results
How facet counts are computed, the multiplicative arithmetic that makes empty result sets inevitable, and the recovery ladder that stops a filter combination becoming a dead end.
6 min read
Autocomplete and Typeahead That People Trust
The latency budget a suggestion has to fit inside, the index structure that makes it possible, and the two safety rules that keep query-log suggestions from embarrassing you.
6 min read
Personalisation vs Relevance: The Trade-off
Why blending a personal signal into a ranking can only help on queries that are genuinely ambiguous, how click entropy tells you which those are, and how the feedback loop closes on itself.
6 min read
Recommendation Systems: Collaborative vs Content-Based
The two families, an item-item similarity computed by hand, and the popularity bias that quietly turns any collaborative system into a bestseller list.
6 min read
The Cold Start Problem
Three different cold starts, the shrinkage estimator that stops one click looking like a hit, and the bandit arithmetic that decides how much traffic exploration deserves.
6 min read
Embeddings for Recommendations: The Two-Tower Model
Why retrieval-scale recommendation converged on two independent encoders, the sampled-softmax correction that stops popular items being over-penalised, and what the architecture structurally cannot do.
6 min read
LLMs in Search: Where They Help and Where They Don’t
The four places a language model can sit in a search pipeline, the published work on LLM rerankers, and the token arithmetic that decides which of those places is affordable.
6 min read
Generative Answers vs Ten Blue Links
What a generated answer costs per query compared with a list of links, which query types each format suits, and the attribution failure that makes the generated version harder to trust.
6 min read
Search Result Diversity and Filter Bubbles
Why ranking purely by relevance produces near-duplicate lists, how maximal marginal relevance fixes it, and what the diversity parameter costs when the query is unambiguous.
6 min read
A/B Testing Search Changes
Why a conventional A/B test is a blunt instrument for a ranking change, the variance arithmetic that makes a paired design sharper, and how team-draft interleaving builds the pairing.
6 min read
Handling Long-Tail and Zero-Result Queries
The shape of a query distribution derived from a Zipf assumption, the arithmetic that turns a zero-result rate into a bound on what it costs you, and the failure that is worse than zero results.
6 min read
Multilingual Search Without Separate Indexes
Why mixing languages in one index corrupts BM25's own statistics, what per-language fields fix, and the analyzer traps that only appear in production.
6 min read
E-commerce Search: Attributes, Stock and Intent
Why product search is a different problem from document search: the ranking objective is expected value, the text is too short to score, and near-miss substitution is a real failure with a real cost.
6 min read
Enterprise Search: Permissions and Access Control
Why filtering results by permission after retrieval destroys recall, the arithmetic that shows how badly, and the index design and staleness handling that make pre-filtering safe.
6 min read
Search Latency: Where the Milliseconds Go
A latency budget allocated across the whole pipeline from a stated p95 target, and the fan-out arithmetic that explains why a system of fast components has a slow tail.
6 min read
Building Search on a Small Budget
A working full-text stack on Postgres you already run, the ranking limitation in its built-in functions that nobody mentions, and an evaluation script so you can measure what adding a reranker buys.
6 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Inference, serving & latency
- Evaluation, benchmarks & LLM-as-judge
- Observability & LLMOps
- Hallucination & failure modes
- LLM cost engineering
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns