Class KeepWordFilterFactory

All Implemented Interfaces:
TokenFilterFactory, IndexComponent

public class KeepWordFilterFactory extends AbstractTokenFilterFactory
A TokenFilterFactory for KeepWordFilter. This filter only keep tokens that are contained in the term set configured via "keep_words" setting. This filter acts like an inverse stop filter.

Configuration options:

  • "keep_words" the array of words / tokens to keep.
  • "keep_words_path" an reference to a file containing the words / tokens to keep. Note: this is an alternative to "keep_words" if both are set an exception will be thrown.
  • "keep_words_case" to use case sensitive keep words. The default is false which corresponds to case-sensitive.
See Also:
  • Method Details

    • create

      public org.apache.lucene.analysis.TokenStream create(org.apache.lucene.analysis.TokenStream tokenStream)