On Mon, Aug 10, 2009 at 6:56 PM, Uwe Schindler<u...@thetaphi.de> wrote:
>> Then how do you notify the other filters that they should reset their
>> state?
>> TokenStream.reset()?  The javadoc specifies that it's actually used
>> for something else - but perhaps it can be reused for this purpose?
>
> TokenStream.reset() is always called before the first incrementToken call by
> the the DocInverter. But for extra safety (e.g. with QueryParser and so on),
> you should simply additionally call reset() on the top-level TokenFilter.

If that should be the right way, then we should update the javadoc to
reflect that.
We should also clean up the semantics - it seems like
Analyzer.reusableTokenStream() should take care of calling reset() if
needed, and we can avoid the double-reset.

-Yonik
http://www.lucidimagination.com

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

Reply via email to