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

Error searching for #41

Closed
dmitrypol opened this issue Apr 24, 2017 · 5 comments
Closed

Error searching for #41

dmitrypol opened this issue Apr 24, 2017 · 5 comments

Comments

@dmitrypol
Copy link

dmitrypol commented Apr 24, 2017

FT.CREATE User SCHEMA name TEXT
FT.ADD User 'bob'
FT.SEARCH User ''

RESULT
(error) Syntax error at offset 0 near ''

Sometimes UI searches pass empty strings when person clicks Search w/o specifying anthing

@dvirsky
Copy link
Contributor

dvirsky commented Apr 24, 2017

It's still an error... you should catch that exception in your client, or not pass it to the server at all

@dvirsky
Copy link
Contributor

dvirsky commented Apr 24, 2017

I mean, I might change it, but it's a matter of taste basically.

@dmitrypol
Copy link
Author

dmitrypol commented Apr 24, 2017

I am catching it in my library https://github.com/dmitrypol/redi_search_rails but thought you might want to know

@dvirsky
Copy link
Contributor

dvirsky commented Apr 25, 2017

I know, but I hate to put something like:

if (strlen(query) == 0) {
// ignore the syntax error in the parser
}

so now what if the query is " "? or "   "? or ",. ?---- !!!? " or "a" (which is a stopword) - all of those are empty queries, I don't want to pre-process the query. I want the parser to just get it and do its best to parse it.

@dvirsky
Copy link
Contributor

dvirsky commented Apr 25, 2017

let's try this - I've added a rule in the grammar for empty queries. pull master and try it.

@dvirsky dvirsky closed this as completed Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants