Class CmsSolrSpellchecker

  • public final class CmsSolrSpellchecker
    extends java.lang.Object
    CmsSolrSpellchecker is used to perform spellchecking in OpenCms by using Solr. The JSON-formatted result of the spellchecking operation contains suggestions for misspelled words and is compatible with the expected structure of the tinyMCE editor.
    • Method Detail

      • getInstance

        public static CmsSolrSpellchecker getInstance​(org.apache.solr.core.CoreContainer container)
        Return an instance of this class.
        container - Solr CoreContainer container object in order to create a server object.
        instance of CmsSolrSpellchecker
      • getSpellcheckingResult

        public void getSpellcheckingResult​(javax.servlet.http.HttpServletResponse res,
                                           javax.servlet.ServletRequest servletRequest,
                                           CmsObject cms)
                                    throws CmsPermissionViolationException,
        Performs spellchecking using Solr and returns the spellchecking results using JSON.
        res - The HttpServletResponse object.
        servletRequest - The ServletRequest object.
        cms - The CmsObject object.
        CmsPermissionViolationException - in case of the anonymous guest user - if writing the response fails