Search without a server
Search is the feature people use most and notice least. Our target machine is a 2015 laptop with a spinning disk, because one of us still writes on one.
The index is a plain trigram table: every three-character sequence points to the notes that contain it. A query is split into trigrams, the smallest posting lists are intersected first, and only the surviving notes are opened to confirm the match.
Numbers
On a folder of 8,400 notes (about 60 MB of text) the index is 11 MB and a typical query returns in 4–9 ms. A cold start, with nothing cached, takes about 1.2 s to rebuild from scratch.
What we did not build
No stemming, no fuzzy matching, no ranking model. Results are sorted by modification time, newest first. Every time we tried something smarter the results became harder to predict, and predictability turned out to matter more than recall.
If you need a regular expression, prefix the query with a slash. That path skips the index and is slow on purpose.