diff --git a/graphiti_core/helpers.py b/graphiti_core/helpers.py index 5455f9ff..1e7bec50 100644 --- a/graphiti_core/helpers.py +++ b/graphiti_core/helpers.py @@ -57,6 +57,12 @@ def lucene_sanitize(query: str) -> str: ':': r'\:', '\\': r'\\', '/': r'\/', + 'O': r'\O', + 'R': r'\R', + 'N': r'\N', + 'T': r'\T', + 'A': r'\A', + 'D': r'\D', } ) diff --git a/tests/helpers_test.py b/tests/helpers_test.py index 20029bc0..d709a9a4 100644 --- a/tests/helpers_test.py +++ b/tests/helpers_test.py @@ -23,10 +23,10 @@ def test_lucene_sanitize(): # Call the function with test data queries = [ ( - 'This has every secape character + - && || ! ( ) { } [ ] ^ " ~ * ? : \\ /', - 'This has every secape character \+ \- \&\& \|\| \! \( \) \{ \} \[ \] \^ \\" \~ \* \? \: \\\ \/', + 'This has every escape character + - && || ! ( ) { } [ ] ^ " ~ * ? : \\ /', + '\This has every escape character \+ \- \&\& \|\| \! \( \) \{ \} \[ \] \^ \\" \~ \* \? \: \\\ \/', ), - ('This has no escape characters', 'This has no escape characters'), + ('this has no escape characters', 'this has no escape characters'), ] for query, assert_result in queries: