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 -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.analysis.Analyzer.TokenStreamComponentscreateComponents(String fieldName) Creates a the TokenStreamComponents used to analyze the stream.static org.apache.lucene.analysis.CharArraySetReturns the set of stop words being used.voidreset()Resets the analyzer.Methods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, normalize, tokenStream, tokenStream
-
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:
createComponentsin classorg.apache.lucene.analysis.Analyzer- Parameters:
fieldName- the field that this lucene analyzer will process- Returns:
- the token stream filter chain
-
reset
Resets the analyzer. This must be manually called between searching and indexing.- Throws:
IOException- thrown if there is an error resetting the tokenizer
-