Class NamedAnalyzer

java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.AnalyzerWrapper
org.apache.lucene.analysis.DelegatingAnalyzerWrapper
org.elasticsearch.index.analysis.NamedAnalyzer
All Implemented Interfaces:
Closeable, AutoCloseable

public class NamedAnalyzer extends org.apache.lucene.analysis.DelegatingAnalyzerWrapper
Named analyzer is an analyzer wrapper around an actual analyzer (analyzer that is associated with a name (name().
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer

    org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents
  • Field Summary

    Fields inherited from class org.apache.lucene.analysis.Analyzer

    GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
  • Constructor Summary

    Constructors
    Constructor
    Description
    NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer)
     
    NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer, int positionIncrementGap)
     
    NamedAnalyzer(NamedAnalyzer analyzer, int positionIncrementGap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.lucene.analysis.Analyzer
    The actual analyzer.
    void
    Checks the wrapped analyzer for the provided restricted AnalysisMode and throws an error if the analyzer is not allowed to run in that mode.
    void
     
    boolean
     
    boolean
     
    Returns whether this analyzer can be updated
    int
     
    protected org.apache.lucene.analysis.Analyzer
     
    int
     
    The name of the analyzer.
    The scope of the analyzer.
     

    Methods inherited from class org.apache.lucene.analysis.DelegatingAnalyzerWrapper

    wrapComponents, wrapReader, wrapReaderForNormalization, wrapTokenStreamForNormalization

    Methods inherited from class org.apache.lucene.analysis.AnalyzerWrapper

    attributeFactory, createComponents, getOffsetGap, initReader, initReaderForNormalization, normalize

    Methods inherited from class org.apache.lucene.analysis.Analyzer

    getReuseStrategy, getVersion, normalize, setVersion, tokenStream, tokenStream

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NamedAnalyzer

      public NamedAnalyzer(NamedAnalyzer analyzer, int positionIncrementGap)
    • NamedAnalyzer

      public NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer)
    • NamedAnalyzer

      public NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer, int positionIncrementGap)
  • Method Details

    • name

      public String name()
      The name of the analyzer.
    • scope

      public AnalyzerScope scope()
      The scope of the analyzer.
    • getAnalysisMode

      public AnalysisMode getAnalysisMode()
      Returns whether this analyzer can be updated
    • analyzer

      public org.apache.lucene.analysis.Analyzer analyzer()
      The actual analyzer.
    • getWrappedAnalyzer

      protected org.apache.lucene.analysis.Analyzer getWrappedAnalyzer(String fieldName)
      Specified by:
      getWrappedAnalyzer in class org.apache.lucene.analysis.AnalyzerWrapper
    • getPositionIncrementGap

      public int getPositionIncrementGap(String fieldName)
      Overrides:
      getPositionIncrementGap in class org.apache.lucene.analysis.AnalyzerWrapper
    • checkAllowedInMode

      public void checkAllowedInMode(AnalysisMode mode)
      Checks the wrapped analyzer for the provided restricted AnalysisMode and throws an error if the analyzer is not allowed to run in that mode. The error contains more detailed information about the offending filters that caused the analyzer to not be allowed in this mode.
    • containsBrokenAnalysis

      public boolean containsBrokenAnalysis()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class org.apache.lucene.analysis.Analyzer