Class SpellSuggestEngine

java.lang.Object
com.jalios.jcms.QueryFilter
com.jalios.jcms.search.SpellSuggestEngine
All Implemented Interfaces:
JcmsConstants, PluginComponent, JaliosConstants, Comparable

public class SpellSuggestEngine extends QueryFilter implements JcmsConstants
This engine can be used when doing text search. It suggests alternative text based on a lucene Spell Checker. This lucene SpellChecker is populated from a Dictionnary created using Publication and Category lucene search engine index.
Since:
jcms-5.5.0
  • Constructor Details

  • Method Details

    • isIndexing

      public boolean isIndexing()
    • clearSpellChecker

      public void clearSpellChecker()
      Remove all words from the spellchecker
    • populateSpellChecker

      public void populateSpellChecker()
      Build the spellChecker index from the lucene publication search engine and from the lucene category search engine.
    • getSpellCheckerIndexDir

      public org.apache.lucene.store.Directory getSpellCheckerIndexDir()
      Returns:
      the SpellChecker index directory used by this SpellSuggestEngine.
    • getSpellChecker

      public org.apache.lucene.search.spell.SpellChecker getSpellChecker()
      Returns:
      the SpellChecker used by this SpellSuggestEngine.
    • getIndexingSchedule

      public String getIndexingSchedule()
      Returns:
      the indexing schedule
    • getHitsThreshold

      public int getHitsThreshold()
      Returns:
      the number of hits below which a suggestion should be searched and proposed.
    • setHitsThreshold

      public void setHitsThreshold(int hitsNbr)
      Set the number of hits below which a suggestion should be searched and proposed.
      Parameters:
      hitsNbr - a number of hits
    • getScoreThreshold

      public float getScoreThreshold()
      Returns:
      the score below which a suggestion should be searched and proposed.
    • setScoreThreshold

      public void setScoreThreshold(float score)
      Set the score below which a suggestion should be searched and proposed.
      Parameters:
      score - a score value
    • getWordsThreshold

      public float getWordsThreshold()
      Returns:
      the number of words above which a suggestion is NOT proposed.
    • setWordsThreshold

      public void setWordsThreshold(int wordsNbr)
      Set the number of words above which a suggestion is NOT proposed.
      Parameters:
      wordsNbr - a number of words