Search in sources :

Example 1 with ConjunctionSolrSpellChecker

use of org.apache.solr.spelling.ConjunctionSolrSpellChecker in project lucene-solr by apache.

the class SpellCheckComponent method getSpellChecker.

protected SolrSpellChecker getSpellChecker(SolrParams params) {
    String[] dictName = getDictionaryNames(params);
    if (dictName.length == 1) {
        return spellCheckers.get(dictName[0]);
    } else {
        String singleStr = getDictionaryNameAsSingleString(dictName);
        SolrSpellChecker ssc = spellCheckers.get(singleStr);
        if (ssc == null) {
            ConjunctionSolrSpellChecker cssc = new ConjunctionSolrSpellChecker();
            for (String dn : dictName) {
                cssc.addChecker(spellCheckers.get(dn));
            }
            ssc = cssc;
        }
        return ssc;
    }
}
Also used : ConjunctionSolrSpellChecker(org.apache.solr.spelling.ConjunctionSolrSpellChecker) ConjunctionSolrSpellChecker(org.apache.solr.spelling.ConjunctionSolrSpellChecker) SolrSpellChecker(org.apache.solr.spelling.SolrSpellChecker)

Aggregations

ConjunctionSolrSpellChecker (org.apache.solr.spelling.ConjunctionSolrSpellChecker)1 SolrSpellChecker (org.apache.solr.spelling.SolrSpellChecker)1