fix: escape RediSearch special characters in group_id fulltext queries#1295
Open
StephenBadger wants to merge 1 commit intogetzep:mainfrom
Open
fix: escape RediSearch special characters in group_id fulltext queries#1295StephenBadger wants to merge 1 commit intogetzep:mainfrom
StephenBadger wants to merge 1 commit intogetzep:mainfrom
Conversation
Group IDs containing hyphens or other RediSearch special characters (e.g. "my-group") cause syntax errors in FalkorDB fulltext search queries. The hyphen is interpreted as the RediSearch NOT operator rather than a literal character. Added _escape_redisearch_value() to backslash-escape special characters before interpolating group_ids into fulltext query strings. Applied the fix to both query builder locations: - _build_falkor_fulltext_query() in search_ops.py - FalkorDriver.build_fulltext_query() in falkordb_driver.py
Member
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
danielchalef
added a commit
that referenced
this pull request
Mar 3, 2026
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
"my-group","ap-erp") causeRediSearch: Syntax errorin FalkorDB fulltext search queries-is interpreted as the RediSearch NOT operator rather than a literal character, even when the value is double-quotedRediSearch: Syntax error at offset 14 near apFix
_escape_redisearch_value()helper that backslash-escapes RediSearch special characters (,.<>{}[]"':;!@#$%^&*()-+=~?|/\) before interpolating group_ids into fulltext query strings_build_falkor_fulltext_query()insearch_ops.py(used byFalkorSearchOperations)FalkorDriver.build_fulltext_query()infalkordb_driver.py(used bysearch_utils.fulltext_query()fallback path)Before/After
Reproduction
group_id="my-group"(any group_id containing a hyphen)search_()orsearch()withgroup_ids=["my-group"]RediSearch: Syntax error