Most Search Answers Are Ready Before the Query Arrives

Igor Gordienko28 Oct 2026

Problem

A marketplace search must answer in about 200–300 ms, page rendering included. The catalog holds billions of cards and the load is tens to hundreds of millions of queries a day. A classic index split into shards sends every query to all of them (fan-out), so each new machine adds network calls, tail latency and reindexing time. Caching whole answers fails because a query also carries the shopper (city, purchase history, personal discount).

Example from the article: the query «floor-length dress» typed by thousands of shoppers needs almost the same set of cards each time, yet a classic shard recomputes relevance from scratch for every one.

Solution in brief

Wildberries precomputes sets of candidates per query intent, with relevance already scored offline, and keeps them in the memory of one node. At query time a classifier picks the intent, the request goes to one machine, and CatBoost orders the set for the shopper. About 95% of traffic is served this way; the rest goes to classic online search.

Questions this case answers
  • How to retrieve and rank candidates for a personalized query within a hard latency limit when the item catalog is far too large for one machine and result caching breaks on personalization
  • How to move query-independent retrieval and relevance work offline so that the per-query cost does not grow with catalog size
  • How to retrieve candidates for a search query within 200–300 ms when the catalog holds billions of cards?
  • How to avoid the network fan-out and tail latency of an index sharded across hundreds of machines?

Tools and methods

  • Intent classifier — maps a query to one of about six million intents and so to a set
  • Precomputed candidate sets — offline-scored product lists per intent, held in node memory
  • CatBoost — one-pass personalized ordering of a set, 5–70 ms
  • Hybrid and online search — extra compute on a ready set; full index search for rare queries
Continue reading — it's free

Google or a one-time email code. No password.