lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: CachingTokenFilter#fillCache problem
Date Sat, 05 Sep 2009 06:35:05 GMT
Hi Shay,

>    I was going over and playing with Lucene 2.9 and came around something
> strange that I think might be a bug. In CachingTokenFilter#fillCache it
> seems like captureState is not called on input and instead is called on
> CachingTokenFilter.

This is not a bug and correct behaviour. In general it doesn't matter where
you call captureState(), because all streams and filters in one tokenizer
chain use exactly the same attribute instances. Calling
input.incrementToken() moves forward to next token and after that the
attributes in every filter on the chain contain the same term - just because
they are the same instances.

> Am I missing something? I got to it since QueryParser
> uses the CachingTokenFilter.

You miss the fact of the shared attributes :-)

Thanks for looking into this and reviewing the code!

Uwe


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


Mime
View raw message