You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Luke Shannon <ls...@futurebrand.com> on 2005/02/18 22:35:47 UTC

Analyzing Advise

Hi;

I'm having a situation where my synonyms weren't working for a particular
field.

When I looked at the indexing I noticed it was a Keyword, thus not
tokenized.

The problem is when I switched that field to Text (now tokenized with my
SynonymAnalyzer) a bunch of query queires broke that where testing for
starting with or  or ending with a specific string. My SynonymAnalyzer wraps
a StanardAnalyzer, which acts as I would like for all fields but this one. I
don't want to change the behavior for all tokenizing. Only this one field's
data must remain unaltered.

I was hoping to make a Analyzer, that just applied the Synonyms, that I
could just use on the one field when I added it to the Document. But now
that I'm looking at the API I'm not sure I can specifiy a different analyzer
when creating a field.

Any tips?

Thanks,

Luke



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Analyzing Advise

Posted by Luke Shannon <ls...@futurebrand.com>.
This is exactly what I was looking for.

Thanks

----- Original Message ----- 
From: "Steven Rowe" <sa...@syr.edu>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Friday, February 18, 2005 4:41 PM
Subject: Re: Analyzing Advise


> Luke Shannon wrote:
> > But now that I'm looking at the API I'm not sure I can specifiy a
> > different analyzer when creating a field.
>
> Is PerFieldAnalyzerWrapper what you're looking for?
>
>
<URL:http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/analysis/Pe
rFieldAnalyzerWrapper.html>
>
> Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Analyzing Advise

Posted by Steven Rowe <sa...@syr.edu>.
Luke Shannon wrote:
> But now that I'm looking at the API I'm not sure I can specifiy a
> different analyzer when creating a field.

Is PerFieldAnalyzerWrapper what you're looking for?

<URL:http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.html>

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org