lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: pieces missing in reusable analyzers?
Date Tue, 11 Aug 2009 00:25:50 GMT
On Mon, Aug 10, 2009 at 6:56 PM, Uwe Schindler<uwe@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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message