Class PreConfiguredTokenFilter

All Implemented Interfaces:
AnalysisModule.AnalysisProvider<TokenFilterFactory>

public final class PreConfiguredTokenFilter extends PreConfiguredAnalysisComponent<TokenFilterFactory>
Provides pre-configured, shared TokenFilters.
  • Method Details

    • singleton

      public static PreConfiguredTokenFilter singleton(String name, boolean useFilterForMultitermQueries, Function<org.apache.lucene.analysis.TokenStream,org.apache.lucene.analysis.TokenStream> create)
      Create a pre-configured token filter that may not vary at all.
    • singleton

      public static PreConfiguredTokenFilter singleton(String name, boolean useFilterForMultitermQueries, boolean allowForSynonymParsing, Function<org.apache.lucene.analysis.TokenStream,org.apache.lucene.analysis.TokenStream> create)
      Create a pre-configured token filter that may not vary at all.
    • luceneVersion

      public static PreConfiguredTokenFilter luceneVersion(String name, boolean useFilterForMultitermQueries, BiFunction<org.apache.lucene.analysis.TokenStream,org.apache.lucene.util.Version,org.apache.lucene.analysis.TokenStream> create)
      Create a pre-configured token filter that may vary based on the Lucene version.
    • elasticsearchVersion

      public static PreConfiguredTokenFilter elasticsearchVersion(String name, boolean useFilterForMultitermQueries, BiFunction<org.apache.lucene.analysis.TokenStream,Version,org.apache.lucene.analysis.TokenStream> create)
      Create a pre-configured token filter that may vary based on the Elasticsearch version.
    • elasticsearchVersion

      public static PreConfiguredTokenFilter elasticsearchVersion(String name, boolean useFilterForMultitermQueries, boolean useFilterForParsingSynonyms, BiFunction<org.apache.lucene.analysis.TokenStream,Version,org.apache.lucene.analysis.TokenStream> create)
      Create a pre-configured token filter that may vary based on the Elasticsearch version.
    • shouldUseFilterForMultitermQueries

      public boolean shouldUseFilterForMultitermQueries()
      Can this TokenFilter be used in multi-term queries?
    • create

      protected TokenFilterFactory create(Version version)
      Specified by:
      create in class PreConfiguredAnalysisComponent<TokenFilterFactory>