Thanks for you reply Doron. It works partly on me. How should I customize the Analyzer so as to have the functionality of StandardAnalyzer as well as not stripping out some of the charactors?
Regards, Joe Doron Cohen wrote: > > Hi Joe, > > It must be the standard analyzer's work - try like this: > new QueryParser("keywords", new WhitespaceAnalyzer()) > > Regards, > Doron > > Joe Tang <[EMAIL PROTECTED]> wrote on 26/01/2007 15:48:31: > >> >> I am working on lucene 2.0.0 trying to parse a query with my word "c++" > as a >> keywords but unfortunately it strips out my word as "c". >> >> How can I parse a query like "c++" and "c#"? >> >> Here are the codes >> >> import org.apache.lucene.analysis.standard.StandardAnalyzer; >> import org.apache.lucene.queryParser.ParseException; >> import org.apache.lucene.queryParser.QueryParser; >> import org.apache.lucene.search.Query; >> >> class QueryTest { >> public static void main (String [ ] args){ >> >> String keywords = "java c++"; >> QueryParser qp = new QueryParser("keywords", new > StandardAnalyzer()); >> try { >> >> System.err.println("Query - "+qp.parse(keywords).toString()); > >> >> }catch (ParseException pe){ >> System.err.println("Error Caught: "+pe); >> } >> } >> >> } >> -- >> View this message in context: http://www.nabble.com/QueryParser- >> Strips-%22%2B%2B%22-out-of-my-word-%22c%2B%2B%22-tf3125890.html#a8660921 >> Sent from the Lucene - Java Developer mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/QueryParser-Strips-%22%2B%2B%22-out-of-my-word-%22c%2B%2B%22-tf3125890.html#a8661841 Sent from the Lucene - Java Developer mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]