The corpus

One index, shared by every chapter, so a document frequency you see in chapter 8 is the same one chapter 27 is planning around. It contains repeated terms for saturation, wildly different field lengths for length normalisation, a deliberate misspelling for fuzzy search, shared prefixes for the trie and FST, prices for the point index, and coordinates for BKD.

The corpus

28 documents. Small enough to hold in your head, varied enough to exercise every structure in the book.

documents
28
title vocabulary
71
body vocabulary
423
avg title length
3.61terms

Documents

idtitlestatuspricerating
published149.994.7
published89.54.2
published1294.9
draft102.1
published79.994.5
published1994.8
draft393.4
published1594.6
published04.9
published2494.4
published1194.1
published994.3
published04
published04.8
archived293.2
published1794.7
published1394.2
published2094.5
published04.9
published2994.3
published1094
draft51.4
published05
published05
published1894.6
archived593.8
published1694.4
published04.5

doc-1

Kubernetes Deployment Guide

{
  "id": "doc-1",
  "title": "Kubernetes Deployment Guide",
  "body": "A deployment manages a replica set. The deployment controller reconciles desired state with observed state. Rolling updates replace pods gradually so the service stays available.",
  "status": "published",
  "tags": [
    "kubernetes",
    "deployment",
    "guide"
  ],
  "author": "user_123",
  "price": 149.99,
  "rating": 4.7,
  "created_at": "2026-01-14",
  "lat": 37.77,
  "lon": -122.42
}
title → indexed terms
kubernetes0deployment1guide2
title length
3 terms
body length
25 terms
tags
kubernetes, deployment, guide
location
37.77, -122.42

Mapping

fieldtypebehaviour
titletextAnalyzed into terms. Short field, so length normalisation bites hard.
bodytextThe long field. Where phrase queries and BM25 length normalisation matter.
statuskeywordNot analyzed. `published` is one term, never `publish`.
tagskeywordMulti-valued keyword. Each value is its own term in the same field.
authorkeywordExact identity. Analyzing this would be a bug.
pricenumericIndexed as a point, not a term.
ratingnumericPoint index; also used by scripted scoring.
created_atdateA date is a number wearing a costume.
locationgeo_pointTwo dimensions -> KD/BKD territory.

Vocabulary

71 distinct terms, 96 postings entries

termdocFreqtotalTermFreq
and22
autoscaling11
bkd11
bm2511
caching11
classes11
cloud11
cluster22
clusters33
compose11
consumer11
cost11
deep11
deployment58
dictionaries11
dive11
docker22
dsl11
elasticsearch11
explained11
for33
fst11
guide11
immutable11
in11
index11
infrastructure11
internals11
kafka22
kubernetes810
kubernets11
layout11
local11
lucene11
merging11
mesh11
module11
networking11
nginx11
notes22
numeric11
observability11
of11
operators11
ordering11
partitions11
patterns11
postgres11
practice11
proxy11
query11
ranges11
rebalance11
redis22
relevance11
resharding11
reverse11
rollback11
search33
segment11
service22
setup11
storage11
storms11
strategies11
term11
terraform11
testing11
trees11
trie11
tuning22