Take the 2-minute tour ×  I have a sunspot/solr setup for
fulltext searching model attributes. My QA just searched on "
and +, both of which caused a 500 error:  Solr Response: orgapac
helucenequeryParserParseException_Cannot_parse__Encountered_EOF_
at_line_1_column_0_Was_expecting_one_of_____NOT_________________
_____________QUOTED______TERM______PREFIXTERM______WILDTERM_____
_____________NUMBER______TERM____________  How can I make these
query strings safe? Is there a method in Sunspot to handle this?
share|improve this question possible duplicate of solr
sanitizing query –  Mauricio Scheffer Aug 15 '11 at 20:54 add
comment  1 Answer  There is no method in Sunspot to filter
those, because they are valid in certain kinds of Lucene
queries. Sunspot is using the DisMax Query Parser by default, so
you can read its documentation to learn more about those
characters.  [DisMax] is designed to be support raw input
strings provided by users with no special escaping. '+' and '-'
characters are treated as "mandatory" and