Class SynonymAnalyzer

java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.StopwordAnalyzerBase
com.apple.foundationdb.record.lucene.synonym.SynonymAnalyzer
All Implemented Interfaces:
Closeable, AutoCloseable

public class SynonymAnalyzer extends org.apache.lucene.analysis.StopwordAnalyzerBase
The analyzer for index with synonym enabled.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An analyzer factory including synonym tokenizing on both index time and query time.
    static class 
    An analyzer factory including in fly synonym tokenizing on query time.

    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.StopwordAnalyzerBase

    stopwords

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

    GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
  • Constructor Summary

    Constructors
    Constructor
    Description
    SynonymAnalyzer(org.apache.lucene.analysis.CharArraySet stopwords, String name)
     
    SynonymAnalyzer(org.apache.lucene.analysis.CharArraySet stopwords, String name, int maxTokenLength)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents
     
    int
     
     
    org.apache.lucene.analysis.CharArraySet
     
    protected org.apache.lucene.analysis.TokenStream
    normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)
     
    void
    setMaxTokenLength(int length)
     

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

    getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet

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

    attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SynonymAnalyzer

      public SynonymAnalyzer(@Nullable org.apache.lucene.analysis.CharArraySet stopwords, @Nonnull String name)
    • SynonymAnalyzer

      public SynonymAnalyzer(@Nullable org.apache.lucene.analysis.CharArraySet stopwords, @Nonnull String name, int maxTokenLength)
  • Method Details

    • getName

      @Nonnull public String getName()
    • getStopwords

      @Nullable public org.apache.lucene.analysis.CharArraySet getStopwords()
    • setMaxTokenLength

      public void setMaxTokenLength(int length)
    • getMaxTokenLength

      public int getMaxTokenLength()
    • createComponents

      protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName)
      Specified by:
      createComponents in class org.apache.lucene.analysis.Analyzer
    • normalize

      protected org.apache.lucene.analysis.TokenStream normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)
      Overrides:
      normalize in class org.apache.lucene.analysis.Analyzer