public class HunspellStemFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware
HunspellStemFilter
.
Example config for British English including a custom dictionary, case insensitive matching:
<filter class="solr.HunspellStemFilterFactory" dictionary="en_GB.dic,my_custom.dic" affix="en_GB.aff" ignoreCase="true" />Both parameters dictionary and affix are mandatory.
Modifier and Type | Field and Description |
---|---|
private org.apache.lucene.analysis.hunspell.HunspellDictionary |
dictionary |
private static java.lang.String |
FALSE |
private boolean |
ignoreCase |
private static java.lang.String |
PARAM_AFFIX |
private static java.lang.String |
PARAM_DICTIONARY |
private static java.lang.String |
PARAM_IGNORE_CASE |
private static java.lang.String |
TRUE |
log
args, luceneMatchVersion
Constructor and Description |
---|
HunspellStemFilterFactory() |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.analysis.TokenStream |
create(org.apache.lucene.analysis.TokenStream tokenStream)
Creates an instance of
HunspellStemFilter that will filter the given
TokenStream |
void |
inform(ResourceLoader loader)
Loads the hunspell dictionary and affix files defined in the configuration
|
assureMatchVersion, getArgs, getBoolean, getBoolean, getInt, getInt, getInt, getSnowballWordSet, getWordSet, init, warnDeprecated
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArgs, init
private static final java.lang.String PARAM_DICTIONARY
private static final java.lang.String PARAM_AFFIX
private static final java.lang.String PARAM_IGNORE_CASE
private static final java.lang.String TRUE
private static final java.lang.String FALSE
private org.apache.lucene.analysis.hunspell.HunspellDictionary dictionary
private boolean ignoreCase
public void inform(ResourceLoader loader)
inform
in interface ResourceLoaderAware
loader
- ResourceLoader used to load the filespublic org.apache.lucene.analysis.TokenStream create(org.apache.lucene.analysis.TokenStream tokenStream)
HunspellStemFilter
that will filter the given
TokenStreamcreate
in interface TokenFilterFactory
tokenStream
- TokenStream that will be filtered