Class SolrSpellChecker

    • Constructor Detail

      • SolrSpellChecker

        public SolrSpellChecker()
    • Method Detail

      • init

        public String init​(org.apache.solr.common.util.NamedList<?> config,
                           SolrCore core)
      • modifyRequest

        public void modifyRequest​(ResponseBuilder rb,
                                  ShardRequest sreq)
        modify the shard request to be used in a distributed environment.
      • mergeSuggestions

        public SpellingResult mergeSuggestions​(SpellCheckMergeData mergeData,
                                               int numSug,
                                               int count,
                                               boolean extendedResults)
        Integrate spelling suggestions from the various shards in a distributed environment.
      • getQueryAnalyzer

        public org.apache.lucene.analysis.Analyzer getQueryAnalyzer()
      • getDictionaryName

        public String getDictionaryName()
      • reload

        public abstract void reload​(SolrCore core,
                                    SolrIndexSearcher searcher)
                             throws IOException
        Reloads the index. Useful if an external process is responsible for building the spell checker.
        Throws:
        IOException - If there is a low-level I/O error.
      • build

        public abstract void build​(SolrCore core,
                                   SolrIndexSearcher searcher)
                            throws IOException
        (re)Builds the spelling index. May be a NOOP if the implementation doesn't require building, or can't be rebuilt.
        Throws:
        IOException
      • getAccuracy

        protected float getAccuracy()
        Get the value of SpellingParams.SPELLCHECK_ACCURACY if supported. Otherwise throws UnsupportedOperationException.
      • getStringDistance

        protected org.apache.lucene.search.spell.StringDistance getStringDistance()
        Get the distance implementation used by this spellchecker, or NULL if not applicable.
      • isSuggestionsMayOverlap

        public boolean isSuggestionsMayOverlap()