Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryUtils escaping spaces on searchable text fields #373

Closed
jawalker0 opened this issue Dec 8, 2023 · 0 comments
Closed

QueryUtils escaping spaces on searchable text fields #373

jawalker0 opened this issue Dec 8, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jawalker0
Copy link

jawalker0 commented Dec 8, 2023

Is there a reason why using the .containing(text) in a filter on a @Searchable TextField is escaping spaces in the search query when it goes through QueryUtils.escape()? I think something else is escaping that escaping slash before the space again later in the search process. When I run the query on a field directly in redis-cli , it works, with or without the escape slash. When I run it through om-spring, it's not working, unless I escape the spaces when I save the data in the document field.

For example, I could run either of these through the cli:

ft.search myIndex "@searchText:*some data*"
ft.search myIndex "@searchText:*some\ data*"

and I get the expected results. However, if I run SEARCH_TEXT.containing("some data") through an EntityStream, and output the stream.backingQuery() method results, I see the 2nd query above, but get no results at all when the query runs.

If I escape the searchText field contents when saving the document (so that it's contents end up looking like some\\\\ data\\\\ for\\\\ you, then the EntityStream method will give the expected results on the unescaped search parameter. But I don't think the data is supposed to be like that. (It works fine on eq() filters when the text doesn't include the escape characters and the filter doesn't try to add them there.)

@bsbodden bsbodden self-assigned this Jan 2, 2024
@bsbodden bsbodden added the bug Something isn't working label Mar 1, 2024
bsbodden added a commit to bsbodden/redis-om-spring that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants