Class HunspellService
- java.lang.Object
-
- org.elasticsearch.indices.analysis.HunspellService
-
public class HunspellService extends java.lang.ObjectServes as a node level registry for hunspell dictionaries. This services expects all dictionaries to be located under the<path.conf>/hunspelldirectory, where each locale has its dedicated sub-directory which holds the dictionary files. For example, the dictionary files foren_USlocale must be placed under<path.conf>/hunspell/en_USdirectory.The following settings can be set for each dictionary:
ignore_case- If true, dictionary matching will be case insensitive (defaults tofalse)strict_affix_parsing- Determines whether errors while reading a affix rules file will cause exception or simple be ignored (defaults totrue)
These settings can either be configured as node level configuration, such as:
indices.analysis.hunspell.dictionary.en_US.ignore_case: true indices.analysis.hunspell.dictionary.en_US.strict_affix_parsing: falseor, as dedicated configuration per dictionary, placed in a
settings.ymlfile under the dictionary directory. For example, the following can be the content of the<path.config>/hunspell/en_US/settings.ymlfile:
ignore_case: true strict_affix_parsing: false- See Also:
HunspellTokenFilterFactory
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<Settings>HUNSPELL_DICTIONARY_OPTIONSstatic Setting<java.lang.Boolean>HUNSPELL_IGNORE_CASEstatic Setting<java.lang.Boolean>HUNSPELL_LAZY_LOAD
-
Constructor Summary
Constructors Constructor Description HunspellService(Settings settings, Environment env, java.util.Map<java.lang.String,org.apache.lucene.analysis.hunspell.Dictionary> knownDictionaries)
-
Method Summary
Modifier and Type Method Description org.apache.lucene.analysis.hunspell.DictionarygetDictionary(java.lang.String locale)Returns the hunspell dictionary for the given locale.
-
-
-
Constructor Detail
-
HunspellService
public HunspellService(Settings settings, Environment env, java.util.Map<java.lang.String,org.apache.lucene.analysis.hunspell.Dictionary> knownDictionaries) throws java.io.IOException
- Throws:
java.io.IOException
-
-