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.
        Parameters:
        container - Solr CoreContainer container object in order to create a server object.
        Returns:
        instance of CmsSolrSpellchecker
      • getSpellcheckingResult

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