-
Notifications
You must be signed in to change notification settings - Fork 28
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
Quotation marks need to be escaped in Solr facet queries #17
Comments
Oops, think I commented in the wrong place; posting here too: This did not fix the problem. The " needs to be escaped for Solr as " -- this is different from html encoding See http://lucene.apache.org/core/3_6_0/queryparsersyntax.html#Escaping%20Special%20Characters for more details Also, the isset() replaced the !empty() -- there are cases where $current['facet'] is empty but set. isset() breaks but !empty() catches both cases. |
Oh, sorry... see the isset() !empty() issue is filed on another ticket (which is still open) |
Need to test to see if mysql_real_escape_string has side effects for this; otherwise a quick preg_replace should work... |
Looking a bit more, Apache_Solr_Service::escape() may be what is needed. |
Apache_Solr_Service::escape seemed to introduce extra back-slashes. I may track this down later. |
Current facet link produces something like 39_s:"Smythe,%20William%20"Bill"" (when the thing being faceted has quotes in it).
It should be encoded to something like 39_s:"Smythe,%20William%20%5C"Bill%5C"" (where the quotes are escaped by a backslash).
The first will return zero hits while the second will return the correct number of hits.
The text was updated successfully, but these errors were encountered: