LUCENE-2604: add '/' to the list of chars in the various escape functions

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1294965 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2012-02-29 03:58:41 +00:00
parent 29f9a15de5
commit 29a7c260fe
3 changed files with 3 additions and 3 deletions

View File

@ -1187,7 +1187,7 @@ public abstract class QueryParserBase {
// These characters are part of the query syntax and must be escaped // These characters are part of the query syntax and must be escaped
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':' if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':'
|| c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~' || c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~'
|| c == '*' || c == '?' || c == '|' || c == '&') { || c == '*' || c == '?' || c == '|' || c == '&' || c == '/') {
sb.append('\\'); sb.append('\\');
} }
sb.append(c); sb.append(c);

View File

@ -551,7 +551,7 @@ public class SolrPluginUtils {
for (int i = 0; i < s.length(); i++) { for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i); char c = s.charAt(i);
if (c == '\\' || c == '!' || c == '(' || c == ')' || if (c == '\\' || c == '!' || c == '(' || c == ')' ||
c == ':' || c == '^' || c == '[' || c == ']' || c == ':' || c == '^' || c == '[' || c == ']' || c == '/' ||
c == '{' || c == '}' || c == '~' || c == '*' || c == '?' c == '{' || c == '}' || c == '~' || c == '*' || c == '?'
) { ) {
sb.append('\\'); sb.append('\\');

View File

@ -194,7 +194,7 @@ public class ClientUtils
// These characters are part of the query syntax and must be escaped // These characters are part of the query syntax and must be escaped
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':' if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':'
|| c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~' || c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~'
|| c == '*' || c == '?' || c == '|' || c == '&' || c == ';' || c == '*' || c == '?' || c == '|' || c == '&' || c == ';' || c == '/'
|| Character.isWhitespace(c)) { || Character.isWhitespace(c)) {
sb.append('\\'); sb.append('\\');
} }