lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raymond Balmès <raymond.bal...@gmail.com>
Subject Re: Different analyzer per field ?
Date Tue, 17 Mar 2009 11:35:09 GMT
OK thank's a lot, I must be very poor about searching ;-)... I kind of
missed these information.
Thx again.

-Ray-

On Tue, Mar 17, 2009 at 12:25 PM, Uwe Schindler <uwe@thetaphi.de> wrote:

> It is possible in two ways:
>
> 1. Use the analyzer class and generate a TokenStream/Tokenizer from it.
> Then
> add the field using the c'tor taking a TokenStream. If you want to
> additionally store the field, you have to add another field with the same
> field name, but no index and store enabled. After that, the tokens from the
> token stream (analyzed by your analyzer) are indexed in the field and the
> full contents are stored (if applicable). But if you have different
> analyzers you cannot use QueryParser with that.
>
> 2. Another option is PerFieldAnalyzerWrapper, that is a wrapper that
> chooses
> the right underlying analyzer depending on the used field name. You can use
> this for both indexing and query.
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: Raymond Balmès [mailto:raymond.balmes@gmail.com]
> > Sent: Tuesday, March 17, 2009 12:17 PM
> > To: java-user@lucene.apache.org
> > Subject: Different analyzer per field ?
> >
> > I was looking for calling a different analyzer for each field of a
> > document... looks like it is not possible.
> > Do I have it right ?
> >
> >
> > -Ray-
>
>
>  ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message