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