~bigbes/sr-ht-spec: 36b9e183

feat: search — one global bleve index with per-line ru/en routing

Absorbs warren's index/ and search/ packages, keyword half only, with the
three structural changes the design calls for:

- One global index, not one per project. Every document carries its space;
  a project is a term filter over that field (Query.Spaces), so a merge
  touches one index and the meta-project is a filter that excludes nothing.
- Rebuilds, not incremental updates. RebuildSpace replaces one space at a
  revision, RebuildAll replaces the corpus by building beside the live index
  and swapping. Both report duration in Stats.
- Keyword only. warren's vector store and RRF fusion are not ported, not
  even as dead code; Search returns ranked hits a later ranker can fuse.

Resolves the design's open mixed Russian/English question. Per-document
routing is not sufficient: the ru analyzer passes English through unstemmed
and vice versa, so a Russian spec quoting English requirements loses
singular/plural matching on whichever half is the minority. Text is routed
per line into ru- and en-analyzed field pairs and queried across both.

Not ported: chunking (an embedding concern, and the vector path is Phase 5),
the graph/pages/meta JSON artifacts, and the vault-commit shell-out.

Eugene Blikh <bigbes@gmail.com> — 2026-07-22 11:21:24 UTC

Commit 36b9e1830fa09548dc188dcf7cfed7750021ad2eview raw patch

Parent(s): b217c7a7

10 changed file(s)

FileStatus+
search/extract.go A +124
search/extract_test.go A +151
search/fixture_test.go A +82
search/index.go A +379
search/index_test.go A +476
search/lang.go A +119
search/lang_test.go A +70
search/mapping.go A +166
search/mixed_test.go A +165
search/search.go A +265