feat(search): Full-text search with SQLite FTS5 and Bleve backends#50
Merged
feat(search): Full-text search with SQLite FTS5 and Bleve backends#50
Conversation
added 6 commits
March 3, 2026 09:45
Add Document, SearchOptions, SearchResult types and the Store interface. Add ParseMarkdownStructure() for Goldmark AST-based heading/code extraction.
Add sqlitestore.Store implementing search.Store with SQLite + FTS5. Add schema DDL with triggers for FTS sync, and comprehensive tests.
Add Indexer type that orchestrates markdown file walking and calls Store. Supports full reindex, per-space indexing, and mtime-based incremental updates.
…tion hooks, docs - Add Bleve scorch backend (internal/search/blevestore) - Add conf search command with sqlite/bleve backends, --list-labels/spaces, --format auto - Register newSearchCmd() in root.go - Phase 5: post-pull search index update in cmd/pull.go (non-fatal) - Phase 5: remove .confluence-search-index/ in conf clean - Phase 5: add .confluence-search-index/ to gitignore template (cmd/init.go) and .gitignore - Phase 6: update AGENTS.md and docs/usage.md with conf search reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
conf search QUERY [flags]command for heading-anchored, faceted full-text search over local Confluence Markdown workspacesStoreinterface:--engine sqlite(default, SQLite FTS5 viamodernc.org/sqlite) and--engine bleve(Bleve scorch).confluence-search-index/(gitignored, local-only); updated automatically after eachconf pull(non-fatal)What's included
New packages
internal/search/document.go— sharedDocument,SearchOptions,SearchResulttypesinternal/search/store.go—Storeinterfaceinternal/search/parser.go— Goldmark AST walker producing heading-anchored sections and code blocksinternal/search/indexer.go— backend-agnosticIndexer(full reindex, per-space, incremental mtime-based)internal/search/sqlitestore/— SQLite FTS5 backend (porter + unicode61 tokenizer, JSON label filtering)internal/search/blevestore/— Bleve scorch backend (disjunction query with field boosts)CLI
cmd/search.go—newSearchCmd(),runSearch(), text/JSON formatters,updateSearchIndexForSpace()helpercmd/search_test.go— command-level testsIntegration hooks
cmd/pull.go— non-fatal post-pull index update viaupdateSearchIndexForSpace()cmd/clean.go— removes.confluence-search-index/as part of cleancmd/init.go— adds.confluence-search-index/to gitignore template andensureGitignore()entries.gitignore— adds.confluence-search-index/entryDocumentation
AGENTS.md—conf searchcommand reference and recommended agent workflowdocs/usage.md— fullconf search QUERYsection with flag table and examplesKey flags
--space KEY--label LABEL--heading TEXT--enginesqliteorbleve--formattext,json, orauto(TTY→text, pipe→json)--reindex--list-labels/--list-spacesVerification
All tests pass (
go test ./...), build is clean,go fmtapplied.