'How to the @ symbol in RediSearch?

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

{"email": "[email protected]", "is_checked": 1}

I do:

FT.CREATE myidx ON JSON SCHEMA $.email AS email TAG
FT.SEARCH myidx "@email:'[email protected]'"

but I got Syntax error

How can I select with the value "[email protected]"?



Solution 1:[1]

I just ran into this issue and the accepted answer didn't work for me, but I found a solution in this RediSearch issue.

With an index where there's an email field stored as a TAG you can do a search like this:

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

With the @ and . characters escaped.

Here are the docs for querying on TAG fields as well: https://redis.io/docs/stack/search/reference/tags/#querying-tag-fields

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jket