Skip to content

feat: add hard source-prefix filtering to search query path - #296

Merged
hurttlocker merged 1 commit into
mainfrom
xmate/search-source-291
Mar 1, 2026
Merged

hurttlocker merged 1 commit into
mainfrom
xmate/search-source-291

Conversation

@hurttlocker

Copy link
Copy Markdown
Owner

Implements #291.

What changed

  • Added SearchFTSWithFilters(...) in store layer to support project + source prefix filters directly in SQL query path.
  • Updated searchBM25 to call filtered FTS/LIKE search with opts.Source.
  • Kept existing post-search source filter as a safety net, but now filtering is done against the source column earlier.
  • Improved source-filter behavior for connector prefix detection by including obsidian: in connector source classification.
  • Added/updated tests:
    • TestSearchFTSWithFilters_SourcePrefix
    • TestSearchFTSWithFilters_SourceAndProjectTogether
    • TestIsConnectorSource includes obsidian

Why

Previously source filtering happened after top-N retrieval, which could miss matching source results under tight limits and contradicted the issue requirement to filter on source in the search query path.

Validation

  • go test ./internal/store ./internal/search -run 'SearchFTSWithFilters|FilterBySource|IsConnectorSource' -v ✅
  • go test ./... ✅

@hurttlocker
hurttlocker merged commit 295dcb8 into main Mar 1, 2026
4 checks passed
@hurttlocker
hurttlocker deleted the xmate/search-source-291 branch March 1, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants