Package org.apache.solr.analysis
Class TokenizerChain
- java.lang.Object
-
- org.apache.lucene.analysis.Analyzer
-
- org.apache.solr.analysis.SolrAnalyzer
-
- org.apache.solr.analysis.TokenizerChain
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class TokenizerChain extends SolrAnalyzer
An analyzer that uses a tokenizer and a list of token filters to create a TokenStream. It should probably be replaced withCustomAnalyzer
.- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description TokenizerChain(org.apache.lucene.analysis.custom.CustomAnalyzer customAnalyzer)
Copy from CustomAnalyzer.TokenizerChain(org.apache.lucene.analysis.util.CharFilterFactory[] charFilters, org.apache.lucene.analysis.util.TokenizerFactory tokenizer, org.apache.lucene.analysis.util.TokenFilterFactory[] filters)
Creates a new TokenizerChain.TokenizerChain(org.apache.lucene.analysis.util.TokenizerFactory tokenizer, org.apache.lucene.analysis.util.TokenFilterFactory[] filters)
Creates a new TokenizerChain w/o any CharFilterFactories.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents
createComponents(String fieldName)
org.apache.lucene.analysis.util.CharFilterFactory[]
getCharFilterFactories()
org.apache.lucene.analysis.Analyzer
getMultiTermAnalyzer()
org.apache.lucene.analysis.util.TokenFilterFactory[]
getTokenFilterFactories()
org.apache.lucene.analysis.util.TokenizerFactory
getTokenizerFactory()
Reader
initReader(String fieldName, Reader reader)
protected Reader
initReaderForNormalization(String fieldName, Reader reader)
protected org.apache.lucene.analysis.TokenStream
normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)
String
toString()
-
Methods inherited from class org.apache.solr.analysis.SolrAnalyzer
getPositionIncrementGap, setPositionIncrementGap
-
-
-
-
Constructor Detail
-
TokenizerChain
public TokenizerChain(org.apache.lucene.analysis.custom.CustomAnalyzer customAnalyzer)
Copy from CustomAnalyzer.
-
TokenizerChain
public TokenizerChain(org.apache.lucene.analysis.util.TokenizerFactory tokenizer, org.apache.lucene.analysis.util.TokenFilterFactory[] filters)
Creates a new TokenizerChain w/o any CharFilterFactories.- Parameters:
tokenizer
- Factory for the Tokenizer to use, must not be null.filters
- Factories for the TokenFilters to use - if null, will be treated as if empty.
-
TokenizerChain
public TokenizerChain(org.apache.lucene.analysis.util.CharFilterFactory[] charFilters, org.apache.lucene.analysis.util.TokenizerFactory tokenizer, org.apache.lucene.analysis.util.TokenFilterFactory[] filters)
Creates a new TokenizerChain.- Parameters:
charFilters
- Factories for the CharFilters to use, if any - if null, will be treated as if empty.tokenizer
- Factory for the Tokenizer to use, must not be null.filters
- Factories for the TokenFilters to use if any- if null, will be treated as if empty.
-
-
Method Detail
-
getCharFilterFactories
public org.apache.lucene.analysis.util.CharFilterFactory[] getCharFilterFactories()
- Returns:
- array of CharFilterFactories, may be empty but never null
-
getTokenizerFactory
public org.apache.lucene.analysis.util.TokenizerFactory getTokenizerFactory()
- Returns:
- the TokenizerFactory in use, will never be null
-
getTokenFilterFactories
public org.apache.lucene.analysis.util.TokenFilterFactory[] getTokenFilterFactories()
- Returns:
- array of TokenFilterFactories, may be empty but never null
-
initReader
public Reader initReader(String fieldName, Reader reader)
- Overrides:
initReader
in classSolrAnalyzer
-
initReaderForNormalization
protected Reader initReaderForNormalization(String fieldName, Reader reader)
- Overrides:
initReaderForNormalization
in classorg.apache.lucene.analysis.Analyzer
-
createComponents
protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName)
- Specified by:
createComponents
in classorg.apache.lucene.analysis.Analyzer
-
normalize
protected org.apache.lucene.analysis.TokenStream normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)
- Overrides:
normalize
in classorg.apache.lucene.analysis.Analyzer
-
getMultiTermAnalyzer
public org.apache.lucene.analysis.Analyzer getMultiTermAnalyzer()
-
-