Hi

I was wondering if TokenFilter should implement reset(). The reason is it
maintains an internal TokenStream instance, however never reset() that
instance.

I'm using Lucene 2.3.0, and I have a set of TokenFilters which wrap each
other (i.e. TF1(TF2(TF3)))). Each extends TokenFilter() and implements
reset(). As part of the implementation it calls super.reset(). However, that
super.reset() goes to TokenStream.reset() which does nothing, therefore my
TokenFilter extensions' reset() never gets called.

I implemented reset() in TokenFilter like that, and it solved my problem. Is
this the right approach? Am I using an old version of Lucene?

  public void reset() throws IOException {
    super.reset();
    input.reset();
  }

Thanks,
Shai

Reply via email to