Learn these 26 terms and you can read the architecture of almost any search engine, database pipeline, or matching system — and build your own.

INGOAMPT · Learn

How Search Engines Find Anything in Milliseconds: 14 Data & Search Terms Explained for Beginners

Every search box you have ever typed into — a library catalog, an online shop, a music app — sits on top of two invisible stages: a data pipeline that loads millions of records safely, and an information retrieval engine that finds the right one in milliseconds. This guide explains every core term of both stages with drawings, tables, and real code, assuming zero background.

The running example. Throughout this article, imagine you are building a search engine for a giant library catalog: a single 5 GB file containing about 12 million book and article records, from which you must answer messy human queries like “atention is all yu need” — and still return the right paper. Everything below is a tool for exactly that job.

Part 1 · Getting Data In Safely (The Pipeline Phase)

Before you can search anything, you must move millions of raw records from a downloaded file into your own database — without corrupting a single one. These seven terms describe that journey.

1. Streaming

Memory management
Plain English: Read a huge file one record at a time, like drinking through a straw — instead of trying to swallow the whole lake at once.

Suppose your catalog file is 5 GB of text and your laptop has 8 GB of RAM. If your program loads the entire file into memory, plus the parsed objects it builds from it (which typically take 3–5× more space than the raw text), you crash. Streaming means your program holds only one record in memory at any moment: read it, process it, throw it away, read the next. Memory use stays flat — “bounded” — no matter how big the file is.

❌ Load everything RAM (8 GB) 5 GB file + 15 GB of parsed objects 💥 OUT OF MEMORY ✅ Streaming rec 3 rec 2 rec 1 5 GB file on disk → read as a queue RAM holds ONE record (~2 KB) → database, discard Memory graph over time: flat ✓ Memory graph over time: climbs 💥
Fig. 1 — Loading everything makes memory climb until the program dies. Streaming keeps memory flat forever.

In Python, the difference is one function call:

<span class="c"># ❌ Loads all 5 GB into RAM at once</span>
data = open("catalog.xml").read()

<span class="c"># ✅ Streams: yields one record at a time, constant memory</span>
<span class="k">for</span> event, element <span class="k">in</span> ET.iterparse("catalog.xml"):
    process(element)
    element.clear()   <span class="c"># free the record we just handled</span>
Remember it as: streaming = process data as a river, not a lake. Memory stays constant whether the file is 5 MB or 5 TB.

2. Parsing

Raw text → structured objects
Plain English: Turning a flat string of characters into a structured object your program can actually work with — like reading a messy handwritten form and copying it neatly into labeled boxes.

A file on disk is just characters. The text <title>Attention Is All You Need</title> is, to the computer, 45 meaningless bytes. Parsing is the act of recognizing the grammar in those bytes and producing a validated object with named fields. Here is one raw record and the object a parser builds from it:

<span class="c"><!-- BEFORE: raw XML text in the file --></span>
<article key=<span class="k">"journals/ml/Vaswani17"</span>>
  <author>Ashish Vaswani</author>
  <title>Attention Is All You Need</title>
  <year>2017</year>
</article>

<span class="c"># AFTER: a validated Python object</span>
Record(
    key    = <span class="k">"journals/ml/Vaswani17"</span>,
    authors= [<span class="k">"Ashish Vaswani"</span>],
    title  = <span class="k">"Attention Is All You Need"</span>,
    year   = 2017          <span class="c"># note: now a NUMBER, not text</span>
)
Raw characters <title>Attenti… <year>2017</… just bytes 📄 PARSER grammar rules Validated object title : “Attention…” year : 2017 ✓ int named fields ✓ Bad input? The parser REJECTS it here — garbage never reaches your database.
Fig. 2 — Parsing: raw bytes go in, validated objects (or errors) come out.

Parsing is also your first quality gate. If a record says <year>20I7</year> (a typo with the letter I), a good parser raises an error at the door instead of quietly storing corrupt data.

Remember it as: parsing = raw text in, validated objects out. It is where “characters” become “data”.

3. DTD & Entities

XML grammar
Plain English: A DTD is the official rulebook that says which tags a file may contain and in what order. An entity is a nickname for a special character — &eacute; is the nickname for é.

DTD stands for Document Type Definition. Big XML datasets ship with one so every program on Earth agrees on the grammar. A tiny DTD for our catalog might say:

<span class="c"><!-- catalog.dtd — the rulebook --></span>
<!ELEMENT article (author+, title, year)>   <span class="c"><!-- an article = 1+ authors, then title, then year --></span>
<!ELEMENT author  (#PCDATA)>                <span class="c"><!-- author contains plain text --></span>
<!ENTITY  eacute  "&#233;">                 <span class="c"><!-- define nickname: eacute → character 233 = é --></span>

Why do entities exist? Old files could only safely store basic ASCII characters (A–Z, 0–9). Accented names had to be spelled with nicknames. Your parser must translate them, or names get silently mangled:

Written in the fileEntity meansWhat the reader should see
Ren&eacute;e M&uuml;lleré and üRenée Müller
G&ouml;delöGödel
&amp;the & symbol itself&
&lt;script&gt;< and ><script> (as text, not code — a safety feature!)
In the file Ren&eacute;e DTD lookup In your database Renée ✓ Skip this step and 100,000+ author names arrive broken.
Fig. 3 — Entity decoding: the DTD is the dictionary of nicknames.
Remember it as: DTD = grammar rulebook for the file; entity = &nickname; for one character. Decode them or corrupt every accented name.

4. Schema & Ingestion

Database structure + loading
Plain English: The schema is your database’s floor plan — which tables exist, which columns, which types. Ingestion is moving-in day: transporting parsed records into that floor plan.

Before ingesting a single record you declare the schema, exactly like an architect drawing rooms before furniture arrives. In SQL it looks like this:

<span class="c">-- The floor plan (schema)</span>
<span class="k">CREATE TABLE</span> records (
    key      TEXT    <span class="k">PRIMARY KEY</span>,   <span class="c">-- unique ID, duplicates rejected</span>
    title    TEXT    <span class="k">NOT NULL</span>,      <span class="c">-- a record without a title is refused</span>
    year     INTEGER,                <span class="c">-- numbers only: '20I7' cannot enter</span>
    rec_type TEXT                    <span class="c">-- 'article', 'book', 'thesis', ...</span>
);

<span class="c">-- Moving-in day (ingestion), repeated 12 million times while streaming</span>
<span class="k">INSERT INTO</span> records <span class="k">VALUES</span> ('journals/ml/Vaswani17',
                            'Attention Is All You Need', 2017, 'article');

And this is what the data literally looks like inside the database afterwards:

keytitleyearrec_type
journals/ml/Vaswani17Attention Is All You Need2017article
conf/db/Codd70A Relational Model of Data…1970article
books/aw/Knuth68The Art of Computer Programming1968book

The schema enforces rules automatically: a second record with key conf/db/Codd70 is rejected (PRIMARY KEY), a record with no title is rejected (NOT NULL), and year = "twenty seventeen" is rejected (INTEGER). Your floor plan is also your bouncer.

Remember it as: schema = the labeled shelves; ingestion = stocking them. Declare rules once, and the database enforces them 12 million times for free.

5. Immutability

Protecting source truth
Plain English: An immutable object is frozen after creation — no code, anywhere, can change its fields. It protects the original data from accidental edits.

Here is the subtle bug immutability prevents. Suppose your search code “cleans” a title for matching by lowercasing it. With a normal (mutable) object, that cleaning can accidentally overwrite the original — and now your database says the paper is called attention is all you need forever. The authoritative source data has been silently corrupted by a helper function three files away.

<span class="c"># Python: freeze the object at creation</span>
<span class="k">from</span> dataclasses <span class="k">import</span> dataclass

<span class="k">@dataclass(frozen=True)</span>          <span class="c"># ← the magic word</span>
<span class="k">class</span> Record:
    key: str
    title: str
    year: int

r = Record("journals/ml/Vaswani17", "Attention Is All You Need", 2017)

r.title = r.title.lower()         <span class="c"># someone tries to "clean" it…</span>
<span class="c"># 💥 FrozenInstanceError: cannot assign to field 'title'</span>
<span class="c"># The bug is caught INSTANTLY instead of corrupting data silently.</span>

The professional pattern: keep the frozen original, and put any transformed version in a separate field or object. For example an identifier keeps both value (the untouchable original, e.g. 10.1000/ABC.123) and normalized_value (a lowercase copy used only for lookups). You may compare using the normalized copy, but you never overwrite the original.

🧊 FROZEN ORIGINAL (source truth) value: “10.1000/ABC.123” title: “Attention Is All You Need” write attempts → 💥 error copy ✏️ working copy (for matching) normalized: “10.1000/abc.123” clean_title: “attention is all…” Compare with the copy. Never overwrite the original.
Fig. 4 — The frozen original is truth; anything cleaned or lowercased lives in a clearly-labeled copy.
Remember it as: immutability = data wearing a seatbelt. Bugs crash loudly at the moment they happen instead of corrupting records silently.

6. Reconciliation

Counts must match exactly
Plain English: Count what went in, count what came out, and refuse to continue unless the numbers match exactly. Accountants do it with money; data engineers do it with records.

After ingesting millions of records, “it looks fine” is not evidence. Reconciliation is arithmetic proof. Every record must be accounted for — stored, or deliberately skipped with a counted reason:

Ledger lineCount
Records read from the source file12,796,119
→ stored in database8,622,401
→ skipped: author homepages (not publications)4,148,980
→ skipped: other non-publication types24,738
stored + skipped12,796,119 ✓
Difference (must be zero)0 ✓

If the difference were even 1, you stop and investigate. One silently lost record means your pipeline has a leak, and a leak that dropped 1 record today can drop 40,000 tomorrow. In code, reconciliation is a single unforgiving line:

<span class="k">assert</span> stored + skipped == total_read, \
    f"LEAK! {total_read - stored - skipped} records unaccounted for"
Remember it as: reconciliation = accounting for data. In = out + explained skips. Zero tolerance, like a bank balance.

7. Knowing Your Numbers (the Census)

Dataset literacy
Plain English: Before building anything on a dataset, run a census: count everything by category, and memorize the headline numbers. People who know their dataset cold make better decisions — and instantly earn trust in any technical discussion.

A census of our imaginary 12.8-million-record catalog might reveal:

Record typeCountShareKeep for search?
Journal articles4,387,68934.3%✅ yes
Author homepages4,148,98032.4%❌ not publications
Conference papers3,921,21830.6%✅ yes
Theses, books, other338,2322.7%✅ mostly
Total12,796,119100%≈ 8.6M searchable

Look what the census just bought you: you discovered that a third of the file isn’t publications at all — it’s author homepage records that would have polluted every search result. You now know your true search space is ~8.6M records, not 12.8M. You might also discover, say, that 72% of external links are DOIs (persistent document IDs) — telling you which identifier to build your matching around. Every architecture decision downstream depends on numbers like these.

Remember it as: census = count before you build. The headline numbers (total, searchable subset, biggest surprise category) should live in your head, not just in a report.

Part 2 · Finding Things Fast (The Information Retrieval Phase)

The data is in. Now the real question: someone types “atention is all yu need” — three typos — and you must find the right record among 8.6 million in a few milliseconds. Welcome to information retrieval (IR), the science behind every search box.

8. Index & Inverted Index

Why search is instant
Plain English: An inverted index is a pre-built lookup table: for every word, a list of which records contain it — exactly like the index at the back of a textbook. It’s the reason search takes milliseconds instead of minutes.

Without an index, answering a query means reading all 8.6 million records front to back — a full scan that takes minutes (a real full pass over a multi-GB dataset can easily take over 2 minutes even on a fast machine). With an index, you jump straight to the answer. Take three tiny documents:

Doc IDTitle
D1Attention Is All You Need
D2Neural Machine Translation
D3Attention in Neural Networks

The forward direction is document → words. The inverted index flips (“inverts”) it to word → documents:

WordAppears in (the “posting list”)
attentionD1, D3
neuralD2, D3
translationD2
needD1

Query “neural attention”? Look up both words, intersect the lists: {D2, D3} ∩ {D1, D3} = {D3}. Two dictionary lookups and one intersection — no matter whether you have 3 documents or 8.6 million.

❌ Full scan read record 1… no read record 2… no read record 3… no … 8,599,997 more … ⏱ minutes per query ✅ Inverted index “attention” → D1, D3 “neural” → D2, D3 intersect → D3 ✓ ⚡ milliseconds per query Build the index ONCE (slow) → answer MILLIONS of queries (instant)
Fig. 5 — Pay the indexing cost once; every query afterwards is a dictionary lookup.

In SQLite this whole machine is one line — the FTS5 module builds and maintains the inverted index for you:

<span class="k">CREATE VIRTUAL TABLE</span> records_fts <span class="k">USING</span> fts5(title, authors);
<span class="c">-- later: instant full-text search over millions of rows</span>
<span class="k">SELECT</span> * <span class="k">FROM</span> records_fts <span class="k">WHERE</span> records_fts <span class="k">MATCH</span> 'neural attention';
Remember it as: inverted index = the book index at the back of your dataset. Word → list of records. Built once, queried forever.

9. BM25 — the Classic Ranking Formula

Scoring results
Plain English: The index tells you which records match. BM25 decides which matters most, by one big idea: rare shared words count more than common ones.

Matching the word “the” with a record tells you almost nothing — millions of records contain it. Matching a rare surname like “Vaswani” tells you a lot — only a handful do. BM25 (Best Matching 25, invented in the 1990s and still the default baseline in every serious search system) turns that intuition into a score built from three ingredients:

IngredientQuestion it asksEffect on score
IDF (rarity)How rare is this word across ALL records?Rare word (“vaswani”) → big weight. Common word (“the”) → weight near 0.
TF (frequency)How often does it appear in THIS record?More is better — but with diminishing returns (10 mentions isn’t 10× better than 1).
Length normalizationIs this record unusually long?Long records get slightly discounted, so they can’t win just by containing everything.

Worked example — query: attention vaswani, against a 1-million-record collection:

WordRecords containing itRarity weight (IDF, approx.)
the950,000≈ 0.05 (worthless)
attention12,000≈ 4.4
vaswani45≈ 10.0 (gold)
BM25 word weight (higher = more informative) “the” 0.05 — everyone has it “attention” 4.4 “vaswani” 10.0 — rare = strong evidence Record score ≈ sum of weights of the query words it contains (tuned by TF & length)
Fig. 6 — BM25’s core idea in one picture: rarity is evidence.

A record containing both attention and vaswani scores ≈ 14.4 and rockets to rank 1; a record containing only the scores ≈ 0.05 and vanishes. That’s the whole trick.

Remember it as: BM25 = “rare shared words are strong evidence.” It’s the 30-year-old formula every fancy AI method is still measured against.

10. Candidate Generation → Reranking (the Funnel)

Two-stage search
Plain English: Use a cheap, fast method to narrow millions of records down to ~100 plausible candidates, then let an expensive, smart method rank just those 100. Fast where it’s safe, careful where it counts.

Why two stages? Because your smartest matcher (a neural model, or an LLM comparing full records) might take 50 ms per record. Running it on 8.6 million records = 5 days per query. Running it on 100 candidates = half a second. The funnel is how every modern search engine, recommender, and matching system is built:

STAGE 1 · candidate generation (CHEAP: BM25 / index) 8,600,000 records → keep top ~100 STAGE 2 · reranking (EXPENSIVE, smart) 100 → ranked list winner 🏆 ≈ 20 ms total ≈ 100 × 5 ms confident match
Fig. 7 — The retrieval funnel: cheap breadth first, expensive precision second.
Stage 1: CandidatesStage 2: Reranking
Input size8,600,000~100
Cost per recordmicroseconds (index lookup)milliseconds (deep comparison)
JobDon’t lose the right answer (high recall)Put the right answer first (high precision)
Acceptable errors90 wrong candidates? Fine.Wrong #1? Failure.

Crucial insight: Stage 1 only has one job — never drop the correct record from the candidate list. If the truth isn’t among the 100, no amount of brilliant reranking can recover it. This connects directly to recall, coming up in section 13.

Remember it as: funnel = cheap net first, expensive judge second. Stage 1 must not lose the answer; Stage 2 must crown it.

11. Edit Distance (Levenshtein) & Trigrams

Fuzzy / typo-tolerant matching
Plain English: Two ways to measure how similar two spellings are, so that atention still matches attention. Edit distance counts keystrokes to fix a word; trigrams compare overlapping 3-letter chunks.

Edit distance (Levenshtein distance)

The Levenshtein distance between two words is the minimum number of single-character edits — insert, delete, or substitute — needed to turn one into the other. Small distance = very similar.

From → ToEdits neededDistance
atentionattentioninsert one “t”1
jonjohninsert one “h”1
kittensittingsubstitute k→s, e→i, insert g3
graphgraphnone0
a t e n t i o n the typo (8 letters) +1 “t” a tte n t i o n correct (9 letters) Levenshtein distance = 1 → treat as a very likely match.
Fig. 8 — One insertion repairs the typo, so the edit distance is 1.

Trigrams (character 3-grams)

A trigram is any run of 3 consecutive characters. Break both strings into trigram sets and measure how much they overlap — fast, and great for catching typos and partial titles. The word graph becomes:

"graph"  →  { <span class="k">gra</span> , <span class="k">rap</span> , <span class="k">aph</span> }
"graphs" →  { <span class="k">gra</span> , <span class="k">rap</span> , <span class="k">aph</span> , <span class="k">phs</span> }

shared trigrams: 3   ·   total distinct: 4
similarity = 3 / 4 = <span class="k">0.75</span>  → strong match despite the extra letter
“graph” “graphs” gra rap aph phs shared middle = 3 trigrams → 0.75 similarity
Fig. 9 — Overlapping trigrams: the more 3-letter chunks two strings share, the more similar they are.
Edit distanceTrigrams
Measuresexact keystrokes to fixoverlap of 3-char chunks
Best atshort strings, nameslonger text, partial titles
Speedslower (compares whole words)fast (set overlap, index-friendly)
Remember it as: edit distance = “how many keystrokes apart?”; trigrams = “how many 3-letter chunks in common?” Both let typos still match.

12. Top-k Accuracy & MRR

Success metrics
Plain English: Two ways to score your search engine. Top-k accuracy asks “was the right answer in the top k results?” MRR asks “on average, how high did the right answer rank?”

Say you run 4 test queries where you already know the correct answer. You record the position at which the correct answer appeared:

QueryCorrect answer landed at rank…In Top-1?In Top-5?Reciprocal rank (1 ÷ rank)
Q111 / 1 = 1.00
Q231 / 3 = 0.33
Q321 / 2 = 0.50
Q481 / 8 = 0.125

Top-1 accuracy = 1 of 4 = 25%.   Top-5 accuracy = 3 of 4 = 75%.   MRR (Mean Reciprocal Rank) = average of the last column = (1 + 0.33 + 0.50 + 0.125) ÷ 4 = 0.49.

Reciprocal rank: being #1 is worth far more than being #2 11.00 2.50 3.33 4.25 5.20 6 7 8.125 rank of the correct answer →
Fig. 10 — MRR rewards getting the answer to the very top: rank 1 scores 1.00, rank 2 only 0.50.

Which to use? Top-1 matters when you show a single answer. Top-5 matters when the user sees a short list. MRR summarizes overall ranking quality in one number, which makes comparing two search methods easy.

Remember it as: Top-k = “did we catch it in the top k?” (yes/no). MRR = “how near the top, on average?” (one tidy score, higher is better).

13. Precision vs Recall

The eternal trade-off
Plain English: Precision = of the results you returned, how many were right? Recall = of all the right answers that existed, how many did you find? Pushing one up usually pushes the other down.

Imagine a collection contains 10 records that are truly relevant to a query. Your system returns 8 records; 6 of them are actually relevant.

QuantityValue
Results you returned8
…that were actually relevant (correct)6
…that were wrong (false alarms)2
Relevant records you missed entirely4
Precision = 6 correct ÷ 8 returned75%
Recall = 6 found ÷ 10 that exist60%
everything in the collection RELEVANT (10 exist) RETURNED (8 shown) 6 ✓ correct missed 4 → hurts RECALL 2 false alarms → hurt PRECISION Precision = 6/8 = 75% · Recall = 6/10 = 60%
Fig. 11 — The overlap is what you got right. Missed items lower recall; false alarms lower precision.

The trade-off. Return more results and you’ll catch more of the truly relevant ones (recall ↑) but also let in more junk (precision ↓). Return fewer, safer results and precision rises while recall falls. This is exactly why the two-stage funnel works: Stage 1 is tuned for high recall (don’t miss the answer), Stage 2 is tuned for high precision (put the right one first).

Remember it as: precision = “how clean are my results?”; recall = “how complete are my results?” You usually trade one for the other.

14. Baseline

The bar to beat
Plain English: A baseline is the simplest reasonable method — the bar every clever method must clear. If your fancy AI model can’t beat the simple approach, it isn’t earning its complexity.

Before building anything sophisticated, you measure a plain method on the exact same test set. Then every new idea is judged by one question: did it beat the baseline?

MethodComplexityTop-5 accuracyVerdict
Baseline (built-in fuzzy search)none — it already exists62%the bar 📏
BM25 indexlow71%✅ beats baseline
BM25 + trigram fuzzymedium78%✅ better
Embeddings + rerankinghigh (slow, GPU)64%⚠️ barely beats baseline — not worth the cost
baseline 62% baseline62 BM2571 + trigram78 embeddings64 Anything below the dashed line failed to justify itself.
Fig. 12 — The baseline is the dashed line. A method only counts if it clears it by enough to justify its cost.
Remember it as: baseline = the honest bar. “We got 78%” means nothing until you know the simple method already got 62%.

Part 3 · Bonus — Six More Terms Every Data Project Uses

The two phases above are the core. But real pipelines lean on a handful of extra ideas constantly. Here are six worth knowing, each in one screen.

15. Checksum & Integrity

Did the file arrive intact?
Plain English: A checksum (or hash) is a short fingerprint calculated from a file’s exact bytes. If two files have the same fingerprint, they’re the same file. It’s how you prove a 5 GB download didn’t get corrupted.

You run the same math on the official file and your downloaded copy. Identical fingerprints = identical bytes. One flipped bit produces a completely different fingerprint.

official file …bytes… …your download… hash() hash() 7ee332a9c1… 7ee332a9c1… match ✓ intact
Fig. 13 — Same fingerprint, same file. MD5 is fine for catching accidental corruption; SHA-256 is the stronger choice for security.

Integrity is the bigger goal — data hasn’t been damaged or truncated — and a checksum is just one of several independent checks (is the archive readable? is the XML valid? do the counts reconcile?). No single check is enough; you layer them.

Remember it as: checksum = a file’s fingerprint. Match it against the official one before trusting a download.

16. Transactions & Atomicity

All-or-nothing writes
Plain English: A transaction groups several database changes so they all succeed together or all get undone together. Atomicity is that “all-or-nothing” guarantee — no half-finished records.

One catalog record might need writes to 4 tables (the record, its authors, its fields, its links). If the power dies after write 2 of 4, you’d have a broken half-record. A transaction prevents that: nothing is saved until the whole group is confirmed.

<span class="k">BEGIN</span>;                               <span class="c">-- start the all-or-nothing block</span>
  <span class="k">INSERT INTO</span> records      VALUES (...);
  <span class="k">INSERT INTO</span> authors      VALUES (...);
  <span class="k">INSERT INTO</span> field_links  VALUES (...);
<span class="k">COMMIT</span>;                              <span class="c">-- ✅ all saved together</span>
<span class="c">-- if anything failed above → ROLLBACK undoes the whole block</span>

The classic analogy is a bank transfer: money must leave one account and arrive in the other, or neither. A checkpoint extends this idea to huge imports — you commit in groups (say, every 1,000 records) and record the last safely-saved position, so a crash never leaves the database and your progress-marker disagreeing.

Remember it as: transaction = a group of writes with a seatbelt. Atomicity = all or nothing, never half.

17. Raw vs Normalized vs Derived Data

Keep the original untouched
Plain English: Keep three versions of a value clearly separate: the raw original, a normalized copy tidied for matching, and any derived values computed from it. The normalized copy helps search — but must never overwrite the original.
KindExample valuePurpose
Raw / source"An <i>Important</i> Result"the untouchable truth from the source
Plain"An Important Result"markup stripped, still faithful
Normalized"important result"lowercased, for fast comparison
Derivedtokens, trigrams, embedding vectorcomputed features for search

Why so careful? Normalization loses information. "J. Smith Jr." normalized to "j smith" is great for matching but has dropped the “Jr.” Store the normalized form alongside the original, never instead of it. (This is the data-level cousin of immutability from section 5.)

Remember it as: normalize a copy, never the original. You can always recompute a derived value; you can never recover a source value you overwrote.

18. Provenance

Where did this value come from?
Plain English: Provenance is a value’s paper trail — which source, which record, which field it came from, and how it was transformed. It lets you always trace a result back to its origin.

When your system shows a user a title, provenance lets it also answer: Which source gave us this? Was it copied verbatim or cleaned? Can we show the original? That traceability is what makes a system trustworthy rather than a black box.

shown to user source record ID field path transform Any displayed value can be traced all the way back to its origin.
Fig. 14 — Provenance is the unbroken chain from what the user sees back to the exact source field.
Remember it as: provenance = a receipt for every value. Where it came from, and what you did to it.

19. Federated vs Merged

Combining multiple sources
Plain English: A merged system blends many sources into one record and throws the originals away. A federated system keeps each source’s version and links them, so disagreements stay visible.
MergedFederated
Keeps originals?❌ overwrites into one✅ keeps each source
Conflictshidden — you can’t tell who said whatvisible — “Source A says 2020, Source B says 2021”
Add a new sourcerisky re-mergeplug in a new adapter
Trace a mistakehardeasy (see provenance)

An adapter is the translator that converts one source’s format (XML, JSON, CSV…) into your common internal shape, so the rest of the system doesn’t care where a record originally came from. Federated systems link records that look like the same work rather than destructively fusing them — you can always build a merged “view” later, but you can’t un-merge once you’ve thrown originals away.

Remember it as: federated = keep every source’s story and link them; merged = blend into one and lose the receipts.

20. Embeddings, Rank Fusion, Calibration & Abstention

The modern matching toolkit
Plain English: Four ideas that power modern search when plain word-matching isn’t enough — understanding meaning, combining rankings, trusting scores, and knowing when to say “no match.”

Embedding — turns text into a list of numbers (a vector) that captures meaning, so "heart attack" and "myocardial infarction" land close together even though they share no words. Word-matching (BM25) can’t do that; embeddings can. They complement lexical search rather than replacing it.

“meaning space” (simplified to 2-D) “heart attack” “myocardial infarction” “graph neural network” Close = similar meaning, even with zero shared words.
Fig. 15 — Embeddings place related meanings near each other, enabling search by concept, not just keyword.

Rank fusion (RRF) — you often run several searchers (BM25, fuzzy, embeddings) that each produce a ranked list. Reciprocal-Rank Fusion combines them: a record ranked highly by several methods rises to the top. Consensus beats any single opinion.

Calibration — asks whether a confidence score is honest. If your system says “90% sure” on a batch of results, are about 90% of them actually right? A calibrated score you can trust; an uncalibrated “0.9” is just a number.

Abstention — the discipline of returning “no reliable match found” instead of forcing a wrong answer. For citations, medicine, or law, a confident wrong answer is far worse than an honest “I don’t know.”

Remember it as: embeddings = search by meaning · fusion = combine rankings · calibration = honest confidence · abstention = the courage to say “no match.”

Quick-Reference Glossary

Every term in one place — skim it before a discussion or an exam.

TermOne-line definition
StreamingProcess a huge file one record at a time; memory stays flat.
ParsingTurn raw text into validated, structured objects.
DTD / entityXML’s grammar rulebook; &eacute; is a nickname for é.
Schema / ingestionThe database floor plan; moving data into it.
ImmutabilityFrozen objects that can’t be silently changed — protects source truth.
ReconciliationCounts must match exactly: in = out + explained skips.
CensusCount your dataset by category and know the headline numbers cold.
Inverted indexWord → list of records containing it; makes search instant.
BM25Ranking formula where rare shared words count more than common ones.
Candidate → rerankCheap search narrows millions → ~100; expensive scoring picks the winner.
Edit distanceKeystrokes needed to turn one word into another (typo tolerance).
TrigramOverlapping 3-character chunks; compare by how many they share.
Top-k accuracyWas the correct answer in the top k results? (yes/no)
MRRMean reciprocal rank: on average, how high did the answer rank?
PrecisionOf results returned, how many were right? (cleanliness)
RecallOf all right answers, how many did you find? (completeness)
BaselineThe simple method every fancy method must beat.
ChecksumA file’s byte-fingerprint; match it to confirm an intact download.
Transaction / atomicityA group of writes that all succeed or all get undone.
Raw / normalized / derivedOriginal vs tidied-for-matching vs computed values — kept separate.
ProvenanceA value’s paper trail: source, field, and transformations.
Federated vs mergedKeep and link each source vs blend into one and lose originals.
EmbeddingText turned into numbers that capture meaning; search by concept.
Rank fusion (RRF)Combine several ranked lists; consensus rises to the top.
CalibrationWhether a “90% sure” score is actually right ~90% of the time.
AbstentionReturning “no reliable match” instead of a confident wrong answer.

Putting It All Together

Every search system you use runs the same two-act play. Act one gets data in safely: stream it, parse it, decode its grammar, pour it into a schema, freeze the originals, and reconcile the counts until every record is accounted for. Act two finds things fast: build an inverted index, rank with BM25, funnel millions of candidates down to one through reranking, tolerate typos with edit distance and trigrams, and measure yourself honestly with top-k, MRR, precision, recall — always against a baseline.

Learn these 26 terms and you can read the architecture of almost any search engine, database pipeline, or matching system — and build your own.

Published by INGOAMPT · A free learning resource. Share it freely.

Leave a reply

Your email address will not be published. Required fields are marked *