Class CmsSpellcheckDictionaryIndexer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CUSTOM_DICTIONARY
      A regex pattern that applies to custom dictionaries.
      static java.lang.String DEFAULT_DICTIONARY_DIRECTORY
      The default directory that's holding the dictionary files.
      static java.lang.String DICTIONARY_NAME_REGEX
      A regex pattern that applies to the naming of the dictionary files.
      static java.lang.String INDEXES_REGEX
      A regex pattern that applies to the Solr spellcheck directories.
      static java.lang.String ZIP_NAME_REGEX
      A regex pattern that applies to the naming of zipped dictionary files.
    • Field Detail

      • INDEXES_REGEX

        public static final java.lang.String INDEXES_REGEX
        A regex pattern that applies to the Solr spellcheck directories. Matching string example: "spellchecker_en"
        See Also:
        Constant Field Values
      • CUSTOM_DICTIONARY

        public static final java.lang.String CUSTOM_DICTIONARY
        A regex pattern that applies to custom dictionaries. Matching string example: "custom_dict_en.txt"
        See Also:
        Constant Field Values
      • DICTIONARY_NAME_REGEX

        public static final java.lang.String DICTIONARY_NAME_REGEX
        A regex pattern that applies to the naming of the dictionary files. Matching string example: "dict_en.txt"
        See Also:
        Constant Field Values
      • ZIP_NAME_REGEX

        public static final java.lang.String ZIP_NAME_REGEX
        A regex pattern that applies to the naming of zipped dictionary files. Matching string example: "dict_en.zip"
        See Also:
        Constant Field Values
    • Method Detail

      • 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

        public static boolean updatingIndexNecessesary​(CmsObject cms)
        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