lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: $ or £ symbols are excluded from Search Query
Date Wed, 29 Jul 2009 12:23:40 GMT

> Can anyone tell me how I can search my index for $ or £.
$ or £ or euro character are not reserved characters that are specified in QueryParser. I
just verified it using the code below: (in Lucene 2.4.1)

org.apache.lucene.queryParser.QueryParser qp = new org.apache.lucene.queryParser.QueryParser("title",
new WhitespaceAnalyzer());
Query q = qp.parse("$ahmet$ AND £arslan£ te$s£t");

Where the output is : +title:$ahmet$ +title:£arslan£ title:te$s£t

Probably your analyzer is eating up those characters. Are you using StandardAnalyzer or SimpleAnalyzer?
LetterTokenizer and StandardTokenizer breaks/splits words at those characters. If thats the
cause of the problem, use something like WhitespaceAnalyzer or construct your queries programmatically
using Lucene Query API. e.g. TermQuery etc.

And why not to switch latest version. To improve searching and indexing speed Lucene [1][2]
advises to use the latest version.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message