I don't see a reason why this shoul not work though. are you sure you have indexed all fields with this analyzer or do you iterate over terms of another field not being analyzed with the an analyzer using the length filter?!
simon On Mon, Sep 28, 2009 at 1:06 PM, Erdinc Yilmazel <erdincyilma...@gmail.com> wrote: > Sorry if this is a stupid question. I want my index to contain terms that > are at least 4 characters long. So I wrote a simple analyzer and applied > the LengthFilter. When I open the index and get a TermEnum from the > directory, I can still see terms that are less than 4 characters... What do > you think is wrong? I am using lucene 2.9.0. > The analyzer code: > > @Override > public TokenStream tokenStream(String fieldName, Reader reader) { > StandardTokenizer tokenStream = new StandardTokenizer(reader, true); > TokenStream result = new StandardFilter(tokenStream); > result = new LengthFilter(result, 4, 20); > result = new LowerCaseFilter(result); > result = new StopFilter(false, result, stopSet); > return result; > } > > Erdinc > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org