lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Libois <>
Subject Re: Different Analyzer for each Field
Date Mon, 28 Jul 2003 13:58:34 GMT
thank for your answers but i found another way to solve my problem. I 
don't tokenize my field anymore so it doesn't pass trough the analyzer 
and it works. Nevertheless, I will certainly use  in the future what 
you told me.
On Monday, July 28, 2003, at 02:56 PM, Erik Hatcher wrote:

> 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.
> 	Erik
> p.s. You may need to use a CVS version of Lucene for this feature?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message