lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: escaping special characters
Date Wed, 06 Aug 2008 23:05:46 GMT

: String escapedKeywords = QueryParser.escape(keywords);
: Query query = new QueryParser("content", new
: StandardAnalyzer()).parse(escapedKeywords);
: 
: this works with most of the special characters like * and ~ except \ . I
: can't do a search for a keyword like "ho\w" and get results.
: am I doing anything wrong here.

QueryParser.escape will in fact escape a backslash, but keep in mind 
StandardAnalyzer splits on backslash so that may be what's confusing you.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message