Class SearchFieldAnalyzer

java.lang.Object
org.apache.lucene.analysis.Analyzer
org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer
All Implemented Interfaces:
Closeable, 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
    Constructs a new SearchFieldAnalyzer.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents
    Creates a the TokenStreamComponents used to analyze the stream.
    static org.apache.lucene.analysis.CharArraySet
    Returns the set of stop words being used.
    void
    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 Object

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

    • SearchFieldAnalyzer

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

    • 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(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 IOException
      Resets the analyzer. This must be manually called between searching and indexing.
      Throws:
      IOException - thrown if there is an error resetting the tokenizer