System Design · Module 15
Search: indexing, ranking and retrieval
- Lessons
- 15
- Free
- 0
- Reading
- ~5 h
Your progress
0 / 15 lessons done
Sign in to trackLessons
- Search system architecture: an overviewSearch often reads a different representation of your data from the rest of your application. Understanding that boundary helps you debug missing results, stale prices and slow queries.
- Inverted indexes: mapping words to documentsSearch performance depends on the information stored before a query arrives. Understanding postings helps you diagnose missing matches, expensive queries and index growth.
- Boolean retrieval and tiered indexesSearch must enforce customer filters before choosing which results to show. Understanding Boolean execution helps you diagnose missing products, expensive queries and unsafe shortcuts.
- TF-IDF: scoring how relevant a word is to a documentSearch results can match every query word and still appear in the wrong order. TF-IDF gives you an inspectable scoring baseline and helps you understand the ranking formulas built on it.
- BM25: the standard formula for ranking search resultsSearch engines need to distinguish useful word matches from repetition and long descriptions. BM25 gives you an explainable starting point for ranking, and a way to investigate why one result outranks another.
- Query optimization: stop words and champion listsSearch can spend most of its work finding documents that never reach the results page. Reducing that work requires knowing which shortcuts preserve the answer and which change it.
- Query understanding: interpreting user intentSearch can rank the wrong products perfectly when it misunderstands the request. You need to distinguish what the customer required from what your system merely inferred.
- Click signals: improving ranking with user feedbackSearch teams use behavior to improve results, but the current ranking shapes that behavior. You need to separate useful evidence from exposure effects before feeding it back into ranking.
- Search quality metrics: precision, recall and NDCGA search change can return more matching products yet make the first screen worse. These metrics help you locate the failure and decide whether a change deserves a production experiment.
- Index synchronization: keeping search in sync with the databaseSearch is a separate copy of application data. Engineers must keep that copy useful through crashes, retries, schema changes and rebuilds.
- Sharding a search indexA distributed search can return quickly yet omit the best product. You need to understand partitioning, ranking and failure handling before treating its results as complete.
- Vector and hybrid search: retrieving by meaningKeyword search can miss useful products when customers describe a need rather than a product name. Hybrid retrieval adds another way to find candidates without discarding exact identifiers, filters or existing ranking.
- Design: search autocompleteAutocomplete runs before a customer finishes expressing their intent. Its design must control work per keystroke, serve useful suggestions and avoid exposing unsafe query text.
- Design: spelling correction (“Did you mean?”)Search must recover from typing errors without replacing unfamiliar words with popular but unrelated ones. This design connects string algorithms, ranking, API behavior and safe index deployment.
- Design: related and recent searchesSearch suggestions combine private account state with shared behavioral data. Building them well requires careful boundaries around retries, ranking, deletion and background computation.
Practise with
Terms this module teaches 52
Open glossaryApproximate nearest-neighbor search
A search that reduces comparison work while accepting possible misses from the exact nearest set.
Autocomplete
Suggesting complete queries or names from a partially typed input.
Bitmap
A sequence of bits in which each position records whether the corresponding item belongs to a set.
BM25
A lexical ranking function that combines term rarity, diminishing credit for repeated terms and document-length normalization.
Boolean retrieval
Finding documents that satisfy an expression built from conditions combined with AND, OR and NOT.
Champion list
A precomputed selection of documents with strong weights for one search term, used to restrict query candidates.
Click-through rate
The fraction of eligible recorded appearances that receive a click, using a consistent counting rule.
Cosine similarity
The dot product of two nonzero vectors divided by the product of their Euclidean lengths.
Debounce
Delaying an action until a chosen interval has passed without another triggering event.
Directed query pair
A source query and a later query linked as evidence of how someone changed a search.
Document frequency
The number of documents in a defined collection that contain a term at least once.
Document-length normalization
An adjustment to term-frequency evidence that accounts for the length of the document being scored.
Dual write
Two separate writes to independent systems that represent one logical application change.
Dwell time
Elapsed time between opening a destination and a defined later interaction, such as returning to search.
Embedding
A fixed-length numeric representation produced by a model, used to compare inputs in a shared vector space.
Examination propensity
A modeled probability that a user examines a result under a specified presentation context.
History epoch
An account-wide generation number that lets a service reject history writes created before a clear-history operation.
HNSW
Hierarchical Navigable Small World, a graph-based approximate nearest-neighbor index with multiple layers.
Inverse document frequency
A collection-based weight that increases as a term appears in fewer documents. Its exact formula depends on the scoring scheme.
Inverse propensity weighting
Weighting observed feedback by the inverse of its observation probability to correct a specified observation process under stated assumptions.
Inverted index
A search structure that maps each indexed term to the documents containing it.
Levenshtein distance
The smallest number of single-character insertions, deletions and replacements needed to turn one string into another.
Normalized discounted cumulative gain
A graded ranking measure that divides discounted relevance gain by the gain of an ideal ranking at the same cutoff.
Position bias
The effect of a result’s displayed position on the chance that a user interacts with it.
Postings list
The document entries associated with one indexed term, optionally including counts and positions.
Precision at k
The number of relevant results in the first k ranked positions divided by k.
Prefix
A sequence at the beginning of a longer sequence.
Query understanding
Turning search text into an interpretation that separates required matches, structured constraints and possible meanings.
Query-pair confidence
For this session-based model, the fraction of source-query sessions that contribute a particular directed pair.
Query-pair lift
For this session-based model, pair confidence divided by the candidate query’s background session frequency.
Rate smoothing
Combining observed counts with prior evidence to reduce sensitivity to small samples.
Recall at k
The fraction of all relevant items in the evaluation reference retrieved within the first k positions.
Reciprocal rank fusion
A method that combines ranked lists by summing reciprocal contributions based on each item’s rank and a positive constant.
Relevance judgment
An assessment of how well a document or product satisfies a particular query and its context.
Search analyzer
A configured text-processing pipeline that converts input text into terms for indexing or querying.
Search candidate
A document selected for further matching checks or scoring during retrieval.
Search coordinator
The component that routes a search to its required partitions and combines their responses.
Search document
The unit a search system indexes and can return as one result, built from selected source fields.
Search impression
A recorded opportunity to see a search result, measured using an explicit display rule.
Search refresh
An operation that makes recently indexed changes visible to search queries.
Search replica
Another copy of a search partition that provides an alternative location for serving searches.
Search shard
An independently searchable partition containing part of a search index.
Sparse vector
A vector stored by recording its nonzero entries rather than allocating every possible position.
Stop word
A term deliberately removed during text analysis under a chosen language or field policy.
Symmetric deletion index
An index mapping shortened dictionary strings to their original terms. Shortened query strings retrieve possible matches, which require distance verification.
Synonym expansion
Adding approved alternative words or phrases for a search concept without making unrelated requirements optional.
Term frequency
The number of occurrences of a term within one document or indexed field.
Term-frequency saturation
A scoring behavior where additional occurrences of a term add progressively less evidence.
Text analyzer
A pipeline that converts field text into searchable tokens.
TF-IDF
A family of weighting schemes that combines a term’s frequency within a document with its rarity across a document collection.
Tiered index
An index arrangement that searches a selected set of promising postings first and widens to broader postings when needed.
Trie
A tree that represents keys as paths and shares their common prefixes.