Class CmsSpellcheckDictionaryIndexer
java.lang.Object
org.opencms.search.solr.spellchecking.CmsSpellcheckDictionaryIndexer
Helping class for manipulating the Solr spellchecker indices.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A regex pattern that applies to custom dictionaries.static final String
The default directory that's holding the dictionary files.static final String
A regex pattern that applies to the naming of the dictionary files.static final String
A regex pattern that applies to the Solr spellcheck directories.static final String
A regex pattern that applies to the naming of zipped dictionary files. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
parseAndAddDictionaries
(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) Adds all dictionaries that are available in the default directory.static void
parseAndAddZippedDictionaries
(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) static boolean
Checks whether a built of the indices is necessary.
-
Field Details
-
DEFAULT_DICTIONARY_DIRECTORY
The default directory that's holding the dictionary files.- See Also:
-
INDEXES_REGEX
A regex pattern that applies to the Solr spellcheck directories. Matching string example: "spellchecker_en"- See Also:
-
CUSTOM_DICTIONARY
A regex pattern that applies to custom dictionaries. Matching string example: "custom_dict_en.txt"- See Also:
-
DICTIONARY_NAME_REGEX
A regex pattern that applies to the naming of the dictionary files. Matching string example: "dict_en.txt"- See Also:
-
ZIP_NAME_REGEX
A regex pattern that applies to the naming of zipped dictionary files. Matching string example: "dict_en.zip"- See Also:
-
-
Method Details
-
parseAndAddDictionaries
public static void parseAndAddDictionaries(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) Adds all dictionaries that are available in the default directory.- Parameters:
client
- The SolrClient instance object.cms
- the cms context
-
parseAndAddZippedDictionaries
public static void parseAndAddZippedDictionaries(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) - Parameters:
client
- The SolrClient instance object.cms
- The OpenCms instance object.
-
updatingIndexNecessesary
Checks whether a built of the indices is necessary.- Parameters:
cms
- The appropriate CmsObject instance.- Returns:
- true, if the spellcheck indices have to be rebuilt, otherwise false
-