01 Analysis
Text has to become terms
Searching raw words fails on the first plural. Every string that enters the index and every query typed into the palette goes through the same four stages, because if they diverge the query can no longer match the document it came from.
Tokenising on /\w+/ would split Next.js into two words and destroy C++ and C# entirely. On a developer's site those are not edge cases, they are the queries — so internal separators and trailing + and # stay part of the token.
Folding lowercases and strips diacritics, so résumé and resume are one term. It runs per token, never on the whole document: Unicode normalisation changes string length, and the character offsets that highlight search snippets would land on the wrong letters.
Stopwords are dropped — with one deliberate omission. Standard lists remove single letters and very short words, which on a site carrying a C programming series would make the single most important query on the corpus return nothing. c, go and r are kept.
Stemming is Porter's 1980 algorithm, so deployment, deployed and deploying collapse toward one index term. It is 60 lines of regular expressions that fail silently when edited wrongly, which is why the repository carries a test suite pinning its output word by word — including one case that pins a known wart in the algorithm rather than quietly patching a published one.