Fix FTS5 recall for long multi-keyword searches#152
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
@codex review |
|
@greptileai review |
|
@coderabbitai review |
|
You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR modifies FTS5 query escaping logic to switch from implicit AND to OR-based term joining when "auto" mode processes 4+ terms, while preserving implicit AND behavior for shorter queries. Corresponding test expectations are updated to verify the new behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
hybrid_search()returns a result forowner profile career work history years experiencewhen semantic search contributes nothingTest plan
pytest tests/test_search_gaps.pypytest tests/test_search_gaps.py -k 'fts5_long_query_uses_or or hybrid_search_long_query_uses_fts_or_and_returns_results'pytest tests/test_phase6_critical.py -q(fails in unrelated compact-format test)pytest tests/test_enrichment_controller.py -q(fails in unrelated enrichment-controller tests)pytest tests/test_vector_store.py -q(errors dueapsw.BusyError: database is lockedon live DB fixture)pytest tests/(repo-wide suite has many pre-existing unrelated failures/errors outside this change)Notes
brain-bar/build-app.shand2026-03-29-174250-read-collab-gitsorchestratorcollabphase5-har.txtwere intentionally left out.Note
Fix FTS5 recall for long multi-keyword searches by switching to OR matching for 4+ terms
automode,_escape_fts5_querynow joins quoted terms withORwhen there are 4 or more terms, instead of implicitAND(space-separated). Queries with 3 or fewer terms retain AND behavior.automode results for long queries will broaden — documents matching any term are returned instead of only documents matching all terms.Macroscope summarized 5f951a4.
Summary by CodeRabbit