fix(retrieval): report keyword-only search when the index has no vectors
Merged
LE
7d ago+82+82+01234567890123456789-10-10-01234567890123456789
Follow-up to #297. If .vera/vectors.db is deleted or emptied, VectorStore::open recreates an empty store, vector search returns Ok([]), and search silently returns BM25-only results (no stderr warning, no MCP notice; vera update also reports the index as up to date).
Indexing always stores a vector per chunk, so a confirmed zero vector count over an index that has chunks now sets semantic_fallback with "the vector database is missing or empty; re-index to restore vector search". The CLI warns and MCP surfaces it through the existing notice block. The chunk check runs only when the vector count is zero, and a failed vector count is not reported as a missing database.
- Test:
missing_vector_database_is_reported_as_semantic_fallbackdeletesvectors.dbfrom a built index and checks a query with keyword hits and one without. - Checked end to end: CLI warns and
vera mcpreturns the notice after deletingvectors.db; aftervera index .no warning. - Docs: troubleshooting bullet, whats-new v2.1.2.
Summary by CodeRabbit
- Bug Fixes
- Hybrid search now warns when an index contains content but its vector database is missing or empty, while still returning keyword-based results when available.
- Documentation
- Added troubleshooting guidance explaining how to restore missing vectors by rebuilding the index.