Backend Evaluation
Question: stay indexless (sahilm/fuzzy + hand filters) or adopt an embedded full-text library for free-text + fuzzy + faceted custom metadata?
Why bleve was the prior recommendation
Section titled “Why bleve was the prior recommendation”github.com/blevesearch/bleve/v2 (11k★, Apache-2.0, Couchbase-backed) is the only pure-Go option covering all three out of box:
- Free text:
textfields + analyzers, BM25/TF-IDF, highlighting,scorchon-disk orNewMemOnlyin-memory, nocgo. - Fuzzy:
NewFuzzyQuery(Levenshtein) +prefix/regexp/wildcard/match_phrase/query-string. - Facets/custom metadata: dynamic mapping indexes
Raw.author/views/…automatically;terms/numeric-range/date-rangefacets;BooleanQuery(must: facets, should: fuzzy)combines filter + search.
Why not bluge?
Section titled “Why not bluge?”blugelabs/bluge (+ zincsearch/blugehq/fy0 forks) is lighter and faster at indexing with a cleaner API and richer aggregations (Terms/Range/Min/Max/HLL/T-Digest). Reasons to hold off:
- Fragmented ecosystem — unclear canonical fork, near-zero importers, thin docs.
- Mainline query types lack fuzzy/regexp/wildcard (
Term/Phrase/Match/Prefix/Range/Booleanonly);FuzzyQueryexists only in forks, unproven. - Pick
blugeonly if write throughput + readable codebase outweigh fuzzy + facet maturity + community.
Why not SQLite FTS5?
Section titled “Why not SQLite FTS5?”FTS5(porter+trigram) + normal columns gives the fastest indexing and best SQL facets (WHERE type=? AND tag=? GROUP BY). Costs:
- No native fuzzy — needs
spellfix1two-step queries or trigram substring hacks. - Facets/ranking are hand-written SQL, not a search API.
- Go drivers:
mattn/go-sqlite3needscgo(breaks static binary/cross-compile);modernc.org/sqliteis pure-Go but larger/slower; FTS↔content sync (triggers/external-content) is extra work. - Pick FTS5 only if you already need SQLite or persistent SQL joins.
Decision for mdfu
Section titled “Decision for mdfu”- Stay indexless while the <50ms/keystroke budget holds (see Search & Ranking bottleneck + Roadmap optimization tasks).
- Spike a persistent index only if benchmarks miss:
bleve-memfirst (facets UI),blugefor speed comparison, FTS5 for SQL — decide on binary size,cgo, cold-start, query latency. - External servers (
Typesense/Meilisearch) are out of scope: violate the single-static-binary constraint.