@Override public TokenStream create(TokenStream tokenStream) { if (version.onOrAfter(Version.LUCENE_4_4)) { return new KeepWordFilter(tokenStream, keepWords); } else { @SuppressWarnings("deprecation") final TokenStream filter = new Lucene43KeepWordFilter(enablePositionIncrements, tokenStream, keepWords); return filter; } }
@Override public TokenStream create(TokenStream tokenStream) { return new KeepWordFilter(tokenStream, keepWords); }
@Override public TokenStream create(TokenStream input) { // if the set is null, it means it was empty return words == null ? input : new KeepWordFilter(enablePositionIncrements, input, words); }