Search query exceptions
Reported by Michael Hartl | September 25th, 2008 @ 09:36 AM
Putting '@' in a search query breaks Ultrasphinx. For example, searching for "bar@foo" gives
searches#index (Ultrasphinx::UsageError) "index main: query error: no field 'foo' found in schema"
Comments and changes to this ticket
-

Steven Fines September 29th, 2008 @ 06:51 PM
It seems like this is more of a query lacking some escaping than an ultrasphinx exception.
-
Michael Hartl October 3rd, 2008 @ 05:53 PM
In code like
Ultrasphinx::Search.new(:query => query, ...)any escaping should be the job of Search.new. I'm not even sure how to "escape" query; it's not SQL or HTML or anything other than a raw string.
In any case, I think the solution is probably catch the exception somewhere in the controller and render a friendly error message.
-
Michael Hartl October 3rd, 2008 @ 05:39 PM
- → State changed from new to open
- → Assigned user changed from to Michael Hartl
-
Michael Hartl October 3rd, 2008 @ 05:59 PM
- → State changed from open to resolved
I've pushed out a fix to GitHub. N.B. The ".inspect" suggestion at RubyForge didn't work for me.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
