Package org.elasticsearch.index.analysis
Class SynonymTokenFilterFactory
- java.lang.Object
-
- org.elasticsearch.index.AbstractIndexComponent
-
- org.elasticsearch.index.analysis.AbstractTokenFilterFactory
-
- org.elasticsearch.index.analysis.SynonymTokenFilterFactory
-
- All Implemented Interfaces:
TokenFilterFactory,IndexComponent
- Direct Known Subclasses:
SynonymGraphTokenFilterFactory
public class SynonymTokenFilterFactory extends AbstractTokenFilterFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected Environmentenvironmentprotected booleanexpandprotected java.lang.Stringformatprotected booleanignoreCaseDeprecated.this property only works with tokenizer propertyprotected booleanlenientprotected Settingssettingsprotected TokenizerFactorytokenizerFactoryDeprecated.This filter tokenize synonyms with whatever tokenizer and token filters appear before it in the chain in 6.0.-
Fields inherited from class org.elasticsearch.index.analysis.AbstractTokenFilterFactory
version
-
Fields inherited from class org.elasticsearch.index.AbstractIndexComponent
indexSettings, logger
-
Fields inherited from interface org.elasticsearch.index.analysis.TokenFilterFactory
IDENTITY_FILTER
-
-
Constructor Summary
Constructors Constructor Description SynonymTokenFilterFactory(IndexSettings indexSettings, Environment env, AnalysisRegistry analysisRegistry, java.lang.String name, Settings settings)
-
Method Summary
Modifier and Type Method Description org.apache.lucene.analysis.AnalyzerbuildSynonymAnalyzer(TokenizerFactory tokenizer, java.util.List<CharFilterFactory> charFilters, java.util.List<TokenFilterFactory> tokenFilters)protected org.apache.lucene.analysis.synonym.SynonymMapbuildSynonyms(org.apache.lucene.analysis.Analyzer analyzer, java.io.Reader rules)org.apache.lucene.analysis.TokenStreamcreate(org.apache.lucene.analysis.TokenStream tokenStream)TokenFilterFactorygetChainAwareTokenFilterFactory(TokenizerFactory tokenizer, java.util.List<CharFilterFactory> charFilters, java.util.List<TokenFilterFactory> previousTokenFilters, java.util.function.Function<java.lang.String,TokenFilterFactory> allFilters)Rewrite the TokenFilterFactory to take into account the preceding analysis chain, or refer to other TokenFilterFactoriesprotected java.io.ReadergetRulesFromSettings(Environment env)-
Methods inherited from class org.elasticsearch.index.analysis.AbstractTokenFilterFactory
name, version
-
Methods inherited from class org.elasticsearch.index.AbstractIndexComponent
getIndexSettings, index
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.index.analysis.TokenFilterFactory
breaksFastVectorHighlighter, getSynonymFilter
-
-
-
-
Field Detail
-
ignoreCase
@Deprecated protected final boolean ignoreCase
Deprecated.this property only works with tokenizer property
-
format
protected final java.lang.String format
-
expand
protected final boolean expand
-
lenient
protected final boolean lenient
-
settings
protected final Settings settings
-
environment
protected final Environment environment
-
tokenizerFactory
@Deprecated protected final TokenizerFactory tokenizerFactory
Deprecated.This filter tokenize synonyms with whatever tokenizer and token filters appear before it in the chain in 6.0.
-
-
Constructor Detail
-
SynonymTokenFilterFactory
public SynonymTokenFilterFactory(IndexSettings indexSettings, Environment env, AnalysisRegistry analysisRegistry, java.lang.String name, Settings settings) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
create
public org.apache.lucene.analysis.TokenStream create(org.apache.lucene.analysis.TokenStream tokenStream)
-
getChainAwareTokenFilterFactory
public TokenFilterFactory getChainAwareTokenFilterFactory(TokenizerFactory tokenizer, java.util.List<CharFilterFactory> charFilters, java.util.List<TokenFilterFactory> previousTokenFilters, java.util.function.Function<java.lang.String,TokenFilterFactory> allFilters)
Description copied from interface:TokenFilterFactoryRewrite the TokenFilterFactory to take into account the preceding analysis chain, or refer to other TokenFilterFactories- Parameters:
tokenizer- the TokenizerFactory for the preceding chaincharFilters- any CharFilterFactories for the preceding chainpreviousTokenFilters- a list of TokenFilterFactories in the preceding chainallFilters- access to previously defined TokenFilterFactories
-
buildSynonymAnalyzer
public org.apache.lucene.analysis.Analyzer buildSynonymAnalyzer(TokenizerFactory tokenizer, java.util.List<CharFilterFactory> charFilters, java.util.List<TokenFilterFactory> tokenFilters)
-
buildSynonyms
protected org.apache.lucene.analysis.synonym.SynonymMap buildSynonyms(org.apache.lucene.analysis.Analyzer analyzer, java.io.Reader rules)
-
getRulesFromSettings
protected java.io.Reader getRulesFromSettings(Environment env)
-
-