Typeahead at Scale: Autocomplete, Spelling and Facets
A sale night where the search box breaks five ways, and the typeahead system that survives it: a 100 ms keystroke budget with about 15 ms for the server; one search becoming about 12 requests (33,000 a second at peak); debounce, tab cache and a sequence check against stale answers; a trie with top-k at every node, really a prefix-to-list map, and Lucene's FSTs; the engine's options and two lists in one dropdown; building suggestions from logs with distinct users, a 14-day half-life, PII and policy filters, a trending overlay and versioned snapshots; CDN caching by prefix and locale, why first-letter sharding fails, and why an 11 GB index is replicated, not sharded; personalization kept out of shared caches; Hinglish as extra keys built offline; did you mean as a noisy channel; and multi-select facets with post_filter.
Day 4: typeahead at scale.
Previously, on Day 3, you ranked results once a query is submitted: scoring, filters, boosts, and fuzzy matching so a typo still finds something.