Skip to content

fix: group bm25 filters for multiple group ids#1493

Open
mturac wants to merge 1 commit into
getzep:mainfrom
mturac:fix/issue-1249-bm25-group-filter
Open

fix: group bm25 filters for multiple group ids#1493
mturac wants to merge 1 commit into
getzep:mainfrom
mturac:fix/issue-1249-bm25-group-filter

Conversation

@mturac
Copy link
Copy Markdown

@mturac mturac commented May 16, 2026

Summary

Groups multiple Neo4j BM25 group_id filters 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

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

Fix multi-group BM25 search filtering for both the shared search utility path and the Neo4j search operations helper.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • All existing tests pass

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_ids
  • uv run ruff format graphiti_core/search/search_utils.py graphiti_core/driver/neo4j/operations/search_ops.py tests/utils/search/test_search_security.py --check
  • uv run ruff check graphiti_core/search/search_utils.py graphiti_core/driver/neo4j/operations/search_ops.py tests/utils/search/test_search_security.py
  • git diff --check

Note: the full tests/utils/search/test_search_security.py file was not run in this local environment because the existing FalkorDB-specific test imports optional FalkorDB extras that are not installed here.

Breaking Changes

  • This PR contains breaking changes

Checklist

  • Code follows project style guidelines (make lint passes)
  • Self-review completed
  • Documentation updated where necessary
  • No secrets or sensitive information committed

Related Issues

Closes #1249

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.

[BUG] Missing parenthesis for BM25 search method query only searching with the last group_id setted

1 participant