redis / node-redis

Redis Node.js client

Home Page:https://redis.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically escape punctuation for Redisearch?

corywatsonhcl opened this issue · comments

This is a combination question and then potential feature idea. Given that indexing by TEXT on fields like email address can cause troublesome issues with tokenization, I find myself having to do a lot of escaping on JSON documents that I want to store and index but that have fields where I would expect punctuation. I know I can use TAG to get around this, but we need to dual-index sometimes and as of now Redis is the only DB provider where we have to do this escaping. It's more than a bit messy and seems to be a common thing that is forgotten, causing us issues.

So, I'm wondering if there is a way currently within the package that I've yet to find to configure a client to auto-escape and auto-unescape punctuation characters ,.<>{}[]"':;!@#$%^&*()-+=~ on set and get commands. If not, this could be a useful option to add to help users of the package not have to recursively read through every JSON objects they want to store to comment punctuation. It's more of a nice-to-have than anything, so low priority, but something to potentially consider.