● ● ● ● ● ● ● ○ ○   Lesson 7 of 9

Build a docs Skill · A brown-bag

Index the code blocks

The page exists. The word is right there on it. So why does search return nothing at all?

Why · the problem

We now search the whole body (Lesson 3) and rank it well with BM25 (Lesson 6). So search mysqld — a setting on the self-hosted MySQL page. The result isn't ranked low. It's not there at all. The word is absent from the index entirely.

"mysqld (in a config block on the self-hosted MySQL page) was absent from the index entirely." — CORPUS.md, Act H

Why? Because when we built the index, we skipped everything inside code fences — the ``` blocks. We treated code as "not real prose" and threw it away. It felt tidy.

But stop and think about what kind of words live in code blocks: mysqld, pg_hba.conf, hostssl, CLI flags, error strings, file names. Those are exactly the identifiers a platform engineer searches for — and exactly the body-only questions we promised to win back in Lesson 4.

We made our own feature blind The skill's whole value is finding exact identifiers. And identifiers live disproportionately in code blocks. By dropping fenced content, we built a content search that can't see the most content-specific words on the page. The cleanup quietly broke the core promise.
What · the solution approach

The fix is direct: index the code too. Pull the words inside the ``` fences into the page's searchable text, so mysqld becomes findable.

But with one careful twist. There are two different outputs from a page, and they have different jobs:

So we tokenize code into the search text, but keep it out of the preview. Search gets sharper; the preview stays clean. We also harden how we detect fences, so no block slips through.

⏱️ Worth it? Easily. This is a small, build-time change that directly serves the skill's core job — finding exact identifiers. High value, low cost. This is the kind of ancillary work that clearly pays for itself.
How · the mechanics

Take the self-hosted MySQL page. Its body has a config block:

```
[mysqld]
require_secure_transport = ON
ssl-ca = /etc/teleport/ca.pem
```

Watch what happens to that block, before and after the fix:

BEFORE (code fences dropped) AFTER (code tokenized into search text) ────────────────────────────── ────────────────────────────── search "mysqld" → nothing search "mysqld" → page found, ranked in_index = False in_index = True (hostssl, tbot, spiffe too) preview snippet: clean prose preview snippet: STILL clean prose (code stays out of the preview)
Code words join the search text; the human preview is left untouched.
"Fix verified: mysqld, hostssl, tbot, spiffe all in_index=True … Index grew 15.5k → 19.8k terms." — CORPUS.md, Act H

That's about 4,300 new searchable terms — over a quarter more — and they are the high-value ones. The cost? Still zero at query time: we tokenize at build time, the shipped skill just has a richer index.

🔴 → 🟢   The regression we locked in

Red: code-fence content was dropped, so mysqld (and friends) were absent from the index — searching them found nothing.

Green: code is tokenized into the search text (in_index = True; 15.5k → 19.8k terms), kept out of the preview. The body-only evals that depend on code identifiers — pg_hba.conf, hostssl (eval 13) — now hit reliably.

Another short round of Agile iteration: we probed the index, found a gap, fixed it, and locked it with an eval. Notice the pattern across Lessons 3–7 — every improvement came from testing the thing, not admiring it.

Our search is now genuinely good: body, BM25, code blocks, all guarded by evals. So it's time for the question we've been avoiding. A plain model with web search can read these same public docs through Google. Is our skill actually better — or did we just build a slower Google?

That's the reality check: Lesson 8.

Quick self-check (recall before you peek):

1. Why was mysqld missing from the index entirely?

The indexer dropped everything inside code fences, and mysqld only appears in a config block — so it was never indexed.

2. Why do code identifiers matter so much for this skill?

The skill's core value is finding exact identifiers (config keys, flags, file names, errors) — and those live disproportionately in code blocks.

3. Why keep code out of the preview snippet but in the search text?

Search needs every word to match identifiers; the human preview needs to stay short and readable. Two outputs, two jobs.