Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fts): fts on text and tag #586

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion aredis_om/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ def resolve_value(
elif op is Operators.NE:
result = f'-({result}"{value}")'
elif op is Operators.LIKE:
result += value
# FTS for the value
result += f"*{value}*"
else:
raise QueryNotSupportedError(
"Only equals (=), not-equals (!=), and like() "
Expand Down Expand Up @@ -634,6 +635,9 @@ def resolve_value(
else:
value = escaper.escape(value)
result += f"@{field_name}:{{{value}}}"
elif op is Operators.LIKE:
# FTS for the value
result += f"*{value}*"
elif op is Operators.NE:
value = escaper.escape(value)
result += f"-(@{field_name}:{{{value}}})"
Expand Down