lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Different Analyzer for each Field
Date Mon, 28 Jul 2003 12:56:09 GMT
On Monday, July 28, 2003, at 01:32  AM, Claude Libois wrote:
> My question is in the title: how can I use a different   Analyzer for 
> each field of a Document object? My problem is that if I use 
> LetterTokenizer for a field which contains a String representation of 
> a number, after I can't delete it. Probably because this analyzer 
> threw away my number. So I need to use whitespaceTokenizer for this 
> field but I would like to use LetterTokenizer for the other. Can 
> someone help me?
> thank you

My recommendation is to write a custom Analyzer subclass that uses the 
field name on the tokenStream method to effect the internals of the 
analysis process.  Just rip out the internals of the analyzers you want 
to piece together into your own analyzer that has the logic you want.


p.s. You may need to use a CVS version of Lucene for this feature?

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

View raw message