Class SearchFieldAnalyzer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class SearchFieldAnalyzer
    extends org.apache.lucene.analysis.Analyzer
    A Lucene field analyzer used to analyzer queries against the CPE data.
    Author:
    Jeremy Long
    • 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
      SearchFieldAnalyzer()
      Constructs a new SearchFieldAnalyzer.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents​(java.lang.String fieldName)
      Creates a the TokenStreamComponents used to analyze the stream.
      static org.apache.lucene.analysis.CharArraySet getStopWords()
      Returns the set of stop words being used.
      void reset()
      Resets the analyzer.
      • Methods inherited from class org.apache.lucene.analysis.Analyzer

        attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, normalize, tokenStream, tokenStream
      • Methods inherited from class java.lang.Object

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

      • SearchFieldAnalyzer

        public SearchFieldAnalyzer()
        Constructs a new SearchFieldAnalyzer.
    • Method Detail

      • getStopWords

        public static org.apache.lucene.analysis.CharArraySet getStopWords()
        Returns the set of stop words being used.
        Returns:
        the set of stop words being used
      • createComponents

        protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents​(java.lang.String fieldName)
        Creates a the TokenStreamComponents used to analyze the stream.
        Specified by:
        createComponents in class org.apache.lucene.analysis.Analyzer
        Parameters:
        fieldName - the field that this lucene analyzer will process
        Returns:
        the token stream filter chain
      • reset

        public void reset()
                   throws java.io.IOException
        Resets the analyzer. This must be manually called between searching and indexing.
        Throws:
        java.io.IOException - thrown if there is an error resetting the tokenizer