Prerequisites
What it is
A search index is a data structure optimized for finding documents by terms, fields, ranking signals, filters, or embeddings instead of scanning a primary database.
Why it matters
Primary databases are usually not enough for fast, relevant full-text search across large datasets. Search indexes trade extra storage and indexing work for low-latency queries.
How it works
Documents are transformed into tokens and fields, then stored in an inverted index. Updates flow from the source database through events, change streams, or batch indexing jobs.
When to use it
Use a search index for full-text search, code search, email search, product catalogs, logs, and discovery surfaces.
Tradeoffs / failure modes
Indexes are usually eventually consistent. Relevance tuning, reindexing, permissions filtering, and large fan-out queries can become complex.
Tiny example
Slack indexes messages by workspace and channel so users can search years of conversation history quickly.
Related guides and systems
See Full-Text Search, Feed & Timeline Generation, Recommendation Engine, GitHub, Slack, Gmail, and YouTube.
Seen in deeper dives
Capability
Feed & Timeline Generation
Fan-out-on-write vs fan-out-on-read strategies for personalized content feeds
Capability
Full-Text Search
Inverted indexes, relevance tuning, and search-as-you-type for any content type
Capability
Recommendation Engine
Collaborative filtering, content-based, and hybrid approaches to personalized suggestions
Case Study
Airbnb
A two-sided marketplace for search, booking, payments, and trust
Case Study
GitHub
The world's largest code hosting platform powered by Git at scale
Case Study
Gmail
The world's largest email service with AI-powered organization and search
Case Study
Slack
Channel-based messaging for the enterprise workplace
Case Study
YouTube
The world's largest video platform serving billions of hours daily
Related concepts
Bloom Filter
Quickly test whether an item is definitely absent or maybe present.
Cache-Aside
Let the application read through the cache and repopulate missing data on demand.
Embeddings
Represent text, images, users, or items as vectors that capture semantic similarity.