Class CmsSolrSpellchecker
java.lang.Object
org.opencms.search.solr.spellchecking.CmsSolrSpellchecker
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.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CmsSolrSpellchecker
Return an instance of this class.static CmsSolrSpellchecker
getInstance
(org.apache.solr.core.CoreContainer container) Return an instance of this class.void
getSpellcheckingResult
(javax.servlet.http.HttpServletResponse res, javax.servlet.ServletRequest servletRequest, CmsObject cms) Performs spellchecking using Solr and returns the spellchecking results using JSON.void
Parses and adds dictionaries to the Solr index.
-
Field Details
-
SPELLCHECKER_INDEX_CORE
The spellcheck core name.- See Also:
-
-
Method Details
-
getInstance
Return an instance of this class.- Returns:
- instance of CmsSolrSpellchecker
-
getInstance
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, 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 userIOException
- if writing the response fails
-
parseAndAddDictionaries
Parses and adds dictionaries to the Solr index.- Parameters:
cms
- the OpenCms object.- Throws:
CmsRoleViolationException
- in case the user does not have the required role ROOT_ADMIN
-