lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AHMET ARSLAN <iori...@yahoo.com>
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");
System.out.println(q.toString());

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.

[1] http://wiki.apache.org/lucene-java/ImproveIndexingSpeed
[2] http://wiki.apache.org/lucene-java/ImproveSearchingSpeed




      

---------------------------------------------------------------------
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