On 11/5/2013 10:22 PM, Shawn Heisey wrote: > If you do not want the *entire* string treated as a single term for the > query parser, then you cannot use escapeQueryChars. You'll need to > write your own code that is aware of the specific special characters > that you want to escape.
If your query is already available in pieces rather than just a string that the user types in, you could do something like the following. I don't imagine that this level of object detail would be available, though: String escTerm1 = ClientUtils.escapeQueryChars(term1); String escTerm2 = ClientUtils.escapeQueryChars(term2); String escTerm3 = ClientUtils.escapeQueryChars(term3); String queryStr = escTerm1 + " " + escTerm2 + " " + escTerm3; solrQuery.setQuery(queryStr); Thanks, Shawn