Skip to content

feat: full-text search across transcriptions (FTS5) #121

@nikazzio

Description

@nikazzio

Summary

Enable searching across all saved transcriptions using SQLite FTS5, with results shown in the Library view.

Motivation

Users accumulate hundreds of transcribed manuscripts but have no way to find "where did I see that passage about X?". Full-text search is the obvious missing capability.

Proposed approach

  • Create an FTS5 virtual table mirroring the transcription content, keyed by (manifest_id, canvas_index).
  • Populate it on transcription save (trigger or explicit sync).
  • Add a search bar to the Library UI (GET /library/search?q=...).
  • Return results as: manuscript title → page number → snippet with highlighted match.
  • Support HTMX-driven incremental search (debounced, 300ms).

Acceptance criteria

  • FTS5 virtual table created and populated from existing transcriptions
  • Search bar in Library UI
  • Results show manuscript, page number, and context snippet
  • New transcription saves are indexed automatically
  • Search is fast (<200ms for typical queries on ~10k pages)

Technical notes

  • SQLite FTS5 is built-in, no extra dependencies.
  • highlight() and snippet() FTS5 functions handle result formatting.
  • Consider rank ordering for relevance.
  • Migration: backfill FTS index from existing transcriptions table on first run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:libraryLibrary local assets and catalog viewsminorIncrements the minor version when adding new functionality in a backward-compatible manner.priority:P1High prioritystatus:readyReady to be implementedtype:featureNew user-facing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions