fix: group bm25 filters for multiple group ids#1493
Open
mturac wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Groups multiple Neo4j BM25
group_idfilters before appending the full-text query, so searches with more than one group constrain results to any requested group instead of letting Lucene precedence bind the search terms only to the last group.Type of Change
Objective
Fix multi-group BM25 search filtering for both the shared search utility path and the Neo4j search operations helper.
Testing
Validation run:
DISABLE_FALKORDB=1 DISABLE_KUZU=1 DISABLE_NEPTUNE=1 uv run pytest tests/utils/search/test_search_security.py::test_fulltext_query_rejects_invalid_group_ids tests/utils/search/test_search_security.py::test_fulltext_query_groups_multiple_group_ids tests/utils/search/test_search_security.py::test_build_neo4j_fulltext_query_rejects_invalid_group_ids tests/utils/search/test_search_security.py::test_build_neo4j_fulltext_query_groups_multiple_group_idsuv run ruff format graphiti_core/search/search_utils.py graphiti_core/driver/neo4j/operations/search_ops.py tests/utils/search/test_search_security.py --checkuv run ruff check graphiti_core/search/search_utils.py graphiti_core/driver/neo4j/operations/search_ops.py tests/utils/search/test_search_security.pygit diff --checkNote: the full
tests/utils/search/test_search_security.pyfile was not run in this local environment because the existing FalkorDB-specific test imports optional FalkorDB extras that are not installed here.Breaking Changes
Checklist
make lintpasses)Related Issues
Closes #1249