throw e;
}
}
+ private boolean isAlphaNumeric(String query){
+ return query.matches("[a-zA-Z_0-9]+");
+ }
@Override
public JestResult search(PolicyIndexType type, String text) throws IllegalStateException, IllegalArgumentException {
throw new IllegalArgumentException("No search string provided");
}
+ if(!isAlphaNumeric(text)){
+ throw new IllegalArgumentException("Search must be alpha numeric");
+ }
+
QueryStringQueryBuilder mQ = QueryBuilders.queryStringQuery("*"+text+"*");
SearchSourceBuilder searchSourceBuilder =
new SearchSourceBuilder().query(mQ);
return search(type, text);
}
+ if(!isAlphaNumeric(text)){
+ throw new IllegalArgumentException("Search must be alpha numeric");
+ }
+
String matches_s = "";
matches_s = "{\n" +
" \"size\" : "+ ElkConnectorImpl.QUERY_MAXRECORDS + ",\n" +