Autosuggestion services in web search

Tezan Sahu8 Feb 2022

Problem

A search box has to suggest completions on every keystroke. Each request must finish before the user types the next character, and the service handles millions of requests per second. Ranking by query frequency alone fails because users arrive with different intents. The box also runs short for long or misspelled prefixes, and some completions must be blocked by policy. A weak suggestion list costs users extra keystrokes and time.

Example from the article: for the prefix "mark ", a user whose history has "avengers", "captain america" and "iron man" is better served by "mark ruffalo" than by the globally popular "mark zuckerberg".

Solution in brief

Look up candidates by prefix in a trie or inverted index, then re-rank them with context. The re-ranking signals are language, time and recent trends, user history and diversity. Fill coverage gaps with non-prefix matching or generative language models. Filter blocked content. Measure the result offline with rank-based and effort-based metrics such as MRR and e-Saved.

Questions this case answers
  • How to rank candidate completions for a partial input so the intended query appears early, while staying inside a per-keystroke latency budget
  • How to compare ranked suggestion lists offline when the user's goal is to type as little as possible
  • How to make query autocomplete suggestions relevant at every keystroke within a strict latency budget
  • How to personalize query completions by language, time and user history

Tools and methods

  • Trie / inverted index — fast prefix lookup of logged queries
  • Personalized ranking — re-ranks completions by language, time and user history
  • Diversification — removes redundant intents from the list for short prefixes
  • Non-prefix matching and language models — fill the box when prefix lookup returns too little
  • MRR, SR@K, MKS, e-Saved, MRL, α-nDCG — offline QAC metrics
Continue reading — it's free

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