Course contentsShow
← System Design
Lesson 1757 of 1,91942. Real-World System: Search and TypeaheadFree lesson

Typeahead vs Full Search

Understanding how typeahead differs from full search in requirements, latency constraints, and user expectations.

Typeahead vs Full Search

You'll learn: How typeahead differs fundamentally from full search in requirements, latency constraints, and user expectations.

Two Different User Experiences

While both typeahead (autocomplete) and full search use similar underlying technologies like inverted indexes, they serve very different purposes and have distinct design constraints.

Full search happens when a user submits a complete query and expects comprehensive, highly ranked results. The user has finished typing, pressed Enter, and is willing to wait a moment (200-500ms is acceptable).

Typeahead happens as the user is still typing. It suggests completions or top results for partial queries, demanding sub-100ms response times (ideally 50ms or less). The user expects instant feedback with every keystroke.

Key Differences

Latency Requirements

  • Full search: 200-500ms acceptable
  • Typeahead: <50-100ms critical; slower feels broken

Query Characteristics

  • Full search: complete phrases ("best restaurants in Seattle")
  • Typeahead: prefixes ("best res...")

Result Depth

  • Full search: paginated, thousands of results ranked deeply
  • Typeahead: top 5-10 suggestions only

Ranking Complexity

  • Full search: sophisticated ML models, personalization, many signals
  • Typeahead: simpler scoring (popularity, recency), speed-optimized

Index Structure

  • Full search: standard inverted index with full ranking
  • Typeahead: often uses prefix trees (tries), cached popular queries, or specialized prefix indexes

User Expectations

  • Full search: precision and comprehensiveness matter most
  • Typeahead: speed and relevance of top suggestions matter most; users will keep typing if suggestions miss

Key Takeaway:
Typeahead sacrifices ranking sophistication and result depth for extreme speed on prefix queries, while full search prioritizes comprehensive, deeply-ranked results over immediate response.