lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alice" <aliceli...@gmail.com>
Subject RE: Customized Analyzer
Date Tue, 05 Dec 2006 19:14:54 GMT
Sorry, I forgot to include this information:
Doing:
token.setPositionIncrement(0);

It returns
content:"(wind window)"

With:
token.setPositionIncrement(1);

Returns:
content:"wind window"

I really don't get it..

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: terça-feira, 5 de dezembro de 2006 17:09
To: java-user@lucene.apache.org
Subject: Re: Customized Analyzer


: I search my synonyms set and if I find something I return the token like:

: return new Token(synonyms[i], token.startOffset(), token.endOffset(),
: token.type());

: And when it gets do the query I see:
:
: content:"wind window"

When you add your synonym, it's just going into the stream of tokens in
the "next" position .. if you call the Token.setPositionIncrement(0)
method on your new Token before you return it, it will occupy the same
position as the token before it, and QP will make an BooleanQuery out of
those two tokens instead of a PhraseQuery.


-Hoss


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


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


Mime
View raw message