How to the @ symbol in RediSearch?

Viewed 215

I'm using the modules RedisJSON and RediSearch together to perform search queries on JSON data. Given a json list like this:

{"email": "test1@example.com", "is_checked": 1}

I do:

FT.CREATE myidx ON JSON SCHEMA $.email AS email TAG
FT.SEARCH myidx "@email:'test1@example.com'"

but I got Syntax error

How can I select with the value "test1@example.com"?

2 Answers

You can escape special characters, like @, with a backslash:

FT.SEARCH myidx "@email:'test1\@example.com'"

That should do the trick.

Related