Class CmsSpellcheckDictionaryIndexer
java.lang.Object
org.opencms.search.solr.spellchecking.CmsSpellcheckDictionaryIndexer
Helping class for manipulating the Solr spellchecker indices.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringA regex pattern that applies to custom dictionaries.static final StringThe default directory that's holding the dictionary files.static final StringA regex pattern that applies to the naming of the dictionary files.static final StringA regex pattern that applies to the Solr spellcheck directories.static final StringA regex pattern that applies to the naming of zipped dictionary files.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidparseAndAddDictionaries(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) Adds all dictionaries that are available in the default directory.static voidparseAndAddZippedDictionaries(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) static booleanChecks whether a built of the indices is necessary.
- 
Field Details- 
DEFAULT_DICTIONARY_DIRECTORYThe default directory that's holding the dictionary files.- See Also:
 
- 
INDEXES_REGEXA regex pattern that applies to the Solr spellcheck directories. Matching string example: "spellchecker_en"- See Also:
 
- 
CUSTOM_DICTIONARYA regex pattern that applies to custom dictionaries. Matching string example: "custom_dict_en.txt"- See Also:
 
- 
DICTIONARY_NAME_REGEXA regex pattern that applies to the naming of the dictionary files. Matching string example: "dict_en.txt"- See Also:
 
- 
ZIP_NAME_REGEXA regex pattern that applies to the naming of zipped dictionary files. Matching string example: "dict_en.zip"- See Also:
 
 
- 
- 
Method Details- 
parseAndAddDictionariespublic 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
 
- 
parseAndAddZippedDictionariespublic static void parseAndAddZippedDictionaries(org.apache.solr.client.solrj.SolrClient client, CmsObject cms) - Parameters:
- client- The SolrClient instance object.
- cms- The OpenCms instance object.
 
- 
updatingIndexNecessesaryChecks 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
 
 
-