Skip to content

feat(search): add source_prefix filter to scope results by directory#180

Closed
haosenwang1018 wants to merge 1 commit intozilliztech:mainfrom
haosenwang1018:feat/search-source-prefix-178
Closed

feat(search): add source_prefix filter to scope results by directory#180
haosenwang1018 wants to merge 1 commit intozilliztech:mainfrom
haosenwang1018:feat/search-source-prefix-178

Conversation

@haosenwang1018
Copy link
Copy Markdown
Contributor

Summary

  • add optional source_prefix parameter to MemSearch.search()
  • convert prefix to an absolute path and apply a Milvus filter (source like "<prefix>%")
  • add async unit tests to validate filtered and unfiltered behavior

Why

This enables searching within a specific subdirectory without creating separate MemSearch instances, matching the request in #178.

Validation

  • PYTHONPATH=src python -m pytest -q tests/test_core_search_filters.py

Closes #178

zc277584121 added a commit to zc277584121/memsearch that referenced this pull request Mar 31, 2026
Add source_prefix parameter to MemSearch.search() and --source-prefix
CLI option. When set, only chunks whose source path starts with the
given prefix are returned, using Milvus filter expressions.

Closes zilliztech#178
Supersedes zilliztech#180 zilliztech#182

Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
zc277584121 added a commit that referenced this pull request Mar 31, 2026
Add source_prefix parameter to MemSearch.search() and --source-prefix
CLI option. When set, only chunks whose source path starts with the
given prefix are returned, using Milvus filter expressions.

Closes #178
Supersedes #180 #182

Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
@zc277584121
Copy link
Copy Markdown
Collaborator

Superseded by #264 which implements the same feature with a simpler approach. Thanks for the contribution!

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.

Support directory-based filtering in search method

2 participants