Search in sources :

Example 1 with SpellCheckComponent

use of org.apache.solr.handler.component.SpellCheckComponent in project lucene-solr by apache.

the class IndexBasedSpellCheckerTest method testComparator.

@Test
public void testComparator() throws Exception {
    SpellCheckComponent component = (SpellCheckComponent) h.getCore().getSearchComponent("spellcheck");
    assertNotNull(component);
    AbstractLuceneSpellChecker spellChecker;
    Comparator<SuggestWord> comp;
    spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("freq");
    assertNotNull(spellChecker);
    comp = spellChecker.getSpellChecker().getComparator();
    assertNotNull(comp);
    assertTrue(comp instanceof SuggestWordFrequencyComparator);
    spellChecker = (AbstractLuceneSpellChecker) component.getSpellChecker("fqcn");
    assertNotNull(spellChecker);
    comp = spellChecker.getSpellChecker().getComparator();
    assertNotNull(comp);
    assertTrue(comp instanceof SampleComparator);
}
Also used : SuggestWordFrequencyComparator(org.apache.lucene.search.spell.SuggestWordFrequencyComparator) SuggestWord(org.apache.lucene.search.spell.SuggestWord) SpellCheckComponent(org.apache.solr.handler.component.SpellCheckComponent) Test(org.junit.Test)

Aggregations

SuggestWord (org.apache.lucene.search.spell.SuggestWord)1 SuggestWordFrequencyComparator (org.apache.lucene.search.spell.SuggestWordFrequencyComparator)1 SpellCheckComponent (org.apache.solr.handler.component.SpellCheckComponent)1 Test (org.junit.Test)1