A comprehensive overview of three main approaches to query matching in search systems: lexical (preprocessing, expansion, relaxation, translation), graph-based (knowledge graphs for query expansion), and embedding-based (self-supervised and supervised representation learning). Real-world examples from DoorDash, Uber, Yahoo, Amazon, Facebook, GrubHub, and JD illustrate how each method works in production. The post concludes that these approaches are complementary — most systems layer embeddings on top of lexical and graph methods rather than replacing them.

18m read timeFrom eugeneyan.com
Post cover image
Table of contents
Lexical-based: The bedrock of query processingGraph-based: Adding concepts and relationshipsPitfalls of lexical and graph-based approachesEmbedding-based: Decomposing queries into numbersEmbedding-based approaches have pitfalls tooConclusion: Start lexical, then embeddingsReferences