CONTAINS and escaped characters?


#1

I’ve been running into all sorts of issues trying to use CONTAINS to search for escaped characters… specifically, these characters (’, ", \) (single quote, double quote, backslash). I haven’t been able to find a way to make escaping these characters work 100%. For example…

Does anyone know the difference between these 2 queries and why one executes and the other errors out?

SELECT x FROM data WHERE CONTAINS(x, ‘\\’) <-- WORKS FINE

SELECT x FROM data WHERE CONTAINS(x, “\\”) <-- ERRORS OUT

Another example, trying to escape single and double quotes within each respective quotes…

SELECT x FROM data WHERE CONTAINS(x, ‘\’’) <-- ERRORS OUT

SELECT x FROM data WHERE CONTAINS(x, “\”") <-- WORKS FINE

What’s up with N1QL and these escapable characters? Any help or advise would be most appreciated.

Thanks!


#2

Thank you for finding this. I have raised defect MB-30176.
We’ll keep you posted.


#3

Awesome! I’m looking forward to some news on this. Thank you!