···5566## API: Search Stabilization
7788-Highest priority. This work blocks further investment in semantic search, hybrid ranking, and broader discovery features.
88+Highest priority. This work blocks further investment in search quality and broader discovery features.
991010- [x] Stabilize local development and experimentation around a local `file:` database
1111- [x] Document backup, restore, and disk-growth procedures for the experimental local DB
···33333434Completed on [2026-03-25](../CHANGELOG.md#2026-03-25)
35353636-## API: Semantic Search Pipeline
3737-3838-Nomic Embed Text v1.5 via Railway template, async embedding pipeline.
3939-4040-**Blocked on:** API: Search Stabilization
4141-4242-- [ ] Deploy nomic-embed Railway template (`POST /api/embeddings` with Bearer auth)
4343-- [ ] Embedding client in Go API (`internal/embedding/`) calling the Nomic service
4444-- [ ] Embed-worker: consume `embedding_jobs` queue, generate 768-dim vectors, store in `document_embeddings`
4545-- [ ] `GET /search/semantic` endpoint using DiskANN vector_top_k
4646-- [ ] Reembed command for bulk re-generation
4747-4848-## API: Hybrid Search
4949-5050-Combine keyword and semantic results.
3636+## API: FTS5 Search Quality
51375252-**Blocked on:** API: Search Stabilization, API: Semantic Search Pipeline
3838+Improve keyword search quality without external dependencies.
53395454-- [ ] Score normalization (keyword BM25 → [0,1], semantic cosine → [0,1])
5555-- [ ] Weighted merge (0.65 keyword + 0.35 semantic, configurable)
5656-- [ ] Deduplication by document ID
5757-- [ ] `matched_by` metadata in results
4040+**Depends on:** API: Search Stabilization
58415959-## API: Search Quality
6060-6161-**Blocked on:** API: Search Stabilization
6262-6363-- [ ] Field weight tuning based on real queries
4242+- [ ] Synonym expansion at query time (e.g. "repo" matches "repository")
4343+- [ ] Stemming tokenizer (porter or unicode61+porter)
4444+- [ ] Prefix search support for autocomplete
4545+- [ ] Field weight tuning based on real query patterns
6446- [ ] Recency boost for recently updated content
6547- [ ] Star count ranking signal (via Constellation)
6648- [ ] State filtering defaults (exclude closed issues)
+8-5
docs/specs/search.md
···99Search now has two phases:
101011111. Stabilize indexing and activity caching so search is cheap and reliable.
1212-2. Resume semantic and hybrid work only after the base pipeline is stable.
1212+2. Enhance keyword search quality with FTS5 features once the base pipeline is stable.
13131414## Immediate Priority
1515···22222323Production storage is Turso cloud. The reasoning is recorded in `docs/adr/storage.md`, with the comparison inputs in `docs/adr/pg.md` and `docs/adr/turso.md`.
24242525-These tasks block further work on semantic and hybrid search.
2525+These tasks block further work on search quality improvements.
26262727## Planning Decisions
2828···1551552. Direct API reads enqueue background indexing for misses.
1561563. JetStream fills only the recent-activity cache.
1571574. Smoke tests guard the critical paths.
158158-5. Semantic and hybrid search remain blocked until the base pipeline is stable.
158158+5. FTS5 quality improvements (synonyms, stemming, prefix search) follow once the base pipeline is stable.
159159160160## Backfill Strategy
161161···172172| Param | Required | Default | Description |
173173| ------------ | -------- | ------- | ------------------------------------- |
174174| `q` | Yes | — | Query string |
175175-| `mode` | No | keyword | keyword, semantic, or hybrid |
175175+| `mode` | No | keyword | keyword |
176176| `limit` | No | 20 | Results per page (1–100) |
177177| `offset` | No | 0 | Pagination offset |
178178| `collection` | No | — | Filter by collection NSID |
···2272272282284. **JetStream is for recent activity, not authoritative indexing.** Use it to power the cached feed, not to replace Tap or repo re-sync.
229229230230-5. **Semantic search is additive.** It improves discovery for vague queries but is not required for the app to be useful.
230230+5. **FTS5 enhancements are the next quality step.** Synonym expansion, stemming, and prefix search improve discovery without external dependencies.
2312312322326. **Graceful degradation.** The mobile app treats the search API as optional. If Twister is unavailable, handle-based direct browsing still works. Search results link into the same browsing screens.
233233234234## Quality Improvements (Planned)
235235236236+- Synonym expansion at query time (e.g. "repo" matches "repository")
237237+- Stemming tokenizer (porter or unicode61+porter)
238238+- Prefix search support for autocomplete
236239- Field weight tuning based on real query patterns
237240- Recency boost for recently updated content
238241- Collection-aware ranking