redis / redis-om-spring

Spring Data Redis extensions for better search, documents models, and more
MIT License
609 stars 94 forks source link

Redis Search syntax error for "or" keyword in the search string #513

Closed radhakrishna67 closed 6 days ago

radhakrishna67 commented 1 month ago

"FT.SEARCH" "com.demo.DemoIdx" "@name:{Active or}" "LIMIT" "0" "10000"

The above command from Redis Search throws,

"Syntax error at offset 16 near or"

bsbodden commented 1 month ago

@radhakrishna67, can you post the model portion with the name field annotations? Assuming it is a TAG, you'll have to escape the String being passed. Also, post the code that generates that query. Thanks.

bsbodden commented 6 days ago

Escape the tag field as "@name:{Active\\ or}" you can accomplish this with EscapeUtils.escape("@name:{Active or}", true);