lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Roberts <>
Subject Re: Escaping special characters
Date Thu, 07 Apr 2005 09:16:58 GMT
On Thursday 07 Apr 2005 06:38, Chuck Williams wrote:
> Mufaddal Khumri writes (4/6/2005 11:21 PM):
> >Hi,
> >
> >Am new to Lucene. I found the following page:
> > At the bottom
> >of the page there is a section that in order to escape special
> >characters one would use "\".
> >
> >
> >
> >I have an Indexer that indexes product names. Some product names have
> >"-" character in them. When I use my search class to search for product
> >names with - in them it wont find those products.
> How did you index those product names?  I.e., if you used a tokenized
> field for the product names and an analyzer that breaks on the hyphens,
> then there are no hyphenated tokens for you to match.  I would suggest
> using Luke to browse your index and see what you have.
> Chuck

The Lucene In Action book has an excellent chapter on Analysers - well worth a 
read. Of particular interest is some code that allows you to see how a given 
Analyser tokenises an input string.

You can download the source code from the book 
( If you unzip this file you 
will find a directory called "LuceneInAction/src/lia/analysis" and in there 
is a class called AnalyzerDemo (which depends in AnalyzerUtils). Compile this 
and run to see how the Analysers work. Put in your hyphenated strings to see 
how they work too.


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

View raw message