mirror of
https://github.com/samvallad33/vestige.git
synced 2026-04-25 00:36:22 +02:00
fix: push type filters into SQL WHERE clause + expose in MCP search
Type filtering (include_types/exclude_types) was applied post-fetch after the database LIMIT, which could return zero results when all top-N results were of the filtered type. This pushes type filters into the SQL WHERE clause in keyword_search_with_scores() so they apply before the limit. Semantic results still get post-fetch filtering as a safety net since the vector index cannot filter by type. Also adds hybrid_search_filtered() as the new primary method, with the original hybrid_search() delegating to it with no filters for backward compatibility. The MCP search tool now exposes include_types and exclude_types parameters. Includes 5 new test cases covering include, exclude, precedence, empty results, and backward compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
16fe2674ed
commit
f3e25f7503
3 changed files with 565 additions and 314 deletions
605
Cargo.lock
generated
605
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue