ML-Powered Search & RankingQuery Understanding (Intent, Parsing, Rewriting)Medium⏱️ ~2 min

Intent Classification and Routing Strategies

Intent classification assigns a query type and handling strategy that determines which retrieval path to follow. The classifier distinguishes between navigational queries where users seek a specific known item, informational queries seeking knowledge or answers, and transactional queries ready to purchase or book. At Meta and Google, classifiers also detect multifaceted queries that combine intents, such as "best coffee maker reviews under 100," which has both informational and transactional components. Production classifiers run as fast lightweight models with 2 to 5 milliseconds latency at p50. Teams start with rule based heuristics, then bootstrap training labels from behavioral signals like click patterns, dwell time, and conversion events. A query leading to immediate checkout is labeled transactional. A query followed by multiple page visits and reading time is labeled informational. Classifiers typically use gradient boosted trees or shallow neural networks with 50 to 200 features, including unigrams, bigrams, query length, presence of question words, price mentions, and historical click entropy. Confidence thresholds are critical. When confidence falls below 0.6 to 0.7, systems either abstain and use a safe default or fan out to two or three indexes in parallel. Routing decisions must balance coverage and cost. Google Search routes across verticals like web pages, images, news, and maps within a few milliseconds using learned policies that consider query text, user context, and recent interaction history. Airbnb routes between lodging catalog, experiences, and help content based on detected intent and entity types. Enterprise search systems add permission filters to ensure only accessible documents are retrieved. Routing failures are expensive. Sending a product query to a help index yields zero results and frustrates users. Sending a broad informational query to a narrow product index over constrains and misses relevant content.
💡 Key Takeaways
Intent classifiers run in 2 to 5 milliseconds at p50 using gradient boosted trees or shallow neural networks with 50 to 200 features including query text, length, price mentions, and historical click entropy.
Confidence thresholds of 0.6 to 0.7 determine when to fan out to multiple indexes. Parallel fanout adds 10 to 15 milliseconds latency but improves coverage for ambiguous queries.
Training labels are bootstrapped from behavioral signals. Queries leading to immediate checkout are transactional. Queries with multiple page visits and long dwell time are informational.
Routing failures are costly. Sending a product query to a help index yields zero results. Over constraining by routing to a narrow index misses relevant content and increases abandonment.
Enterprise search systems enforce permission filters as required routing output to prevent leakage of restricted documents, verified downstream before retrieval execution.
📌 Examples
Google Search: query "weather san francisco" classified as informational with 0.92 confidence, routed to weather vertical and knowledge graph, returns structured answer in under 200 milliseconds total latency.
Amazon: query "buy iphone 14 pro" classified as transactional with 0.88 confidence, routed to electronics catalog with stock availability filter, skips reviews and articles indexes to reduce fanout cost.
Airbnb: query "things to do paris" classified as experiences with 0.81 confidence, routed to activities index with location filter Paris, separate from lodging catalog to avoid mixing property and activity results.
← Back to Query Understanding (Intent, Parsing, Rewriting) Overview
Intent Classification and Routing Strategies | Query Understanding (Intent, Parsing, Rewriting) - System Overflow