Closed GoogleCodeExporter closed 9 years ago
*Precisions*
The keywordsList is initialized like that :
List<String> keywordsList = new ArrayList<String>();
keywordsList.add("/.*firstKeyword.*/");
keywordsList.add("/.*secondKeyword.*/");
query.field("keywords").hasAnyOf(keywordsList);
Original comment by loupasch...@gmail.com
on 12 Feb 2012 at 9:47
Strings are not regular expressions, and won't be treated like them on
the server.
Please use Patter.compile(String) instead of those strings.
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#compil
e(java.lang.String)
Original comment by scotthernandez
on 13 Feb 2012 at 12:26
Thanks for your advice, you're right, it works !
Here's the new code I use :
List<Pattern> keywordsList = new ArrayList<Pattern>();
keywordsList.add(Pattern.compile(".*firstKeyword.*"));
keywordsList.add(Pattern.compile(".*secondKeyword.*"));
query.field("keywords").hasAnyOf(keywordsList);
Original comment by loupasch...@gmail.com
on 13 Feb 2012 at 6:42
Original issue reported on code.google.com by
loupasch...@gmail.com
on 30 Jan 2012 at 10:37