//Lucene escape method
public static String escape(String s) {
StringBuilder sb = new StringBuilder();
for(int i = 0; i < s.length(); ++i) {
charc = s.charAt(i);
if(c ==92 || c ==43 || c ==45 || c ==33 || c ==40 || c ==41 || c ==58 || c ==94 || c ==91 || c ==93 || c ==34 || c ==123 || c ==125 || c ==126 || c ==42 || c ==63 || c ==124 || c ==38 || c ==47) {
sb.append('\\');
}
sb.append(c);
}
returnsb.toString();
}
//replace special characters withspace
s = s.replaceAll("\\pP", "");