use of org.apache.lucene.search.spell.NGramDistance in project lucene-solr by apache.
the class ConjunctionSolrSpellCheckerTest method test.
@Test
public void test() throws Exception {
ConjunctionSolrSpellChecker cssc = new ConjunctionSolrSpellChecker();
MockSolrSpellChecker levenstein1 = new MockSolrSpellChecker(new LevensteinDistance());
MockSolrSpellChecker levenstein2 = new MockSolrSpellChecker(new LevensteinDistance());
MockSolrSpellChecker ngram = new MockSolrSpellChecker(new NGramDistance());
cssc.addChecker(levenstein1);
cssc.addChecker(levenstein2);
try {
cssc.addChecker(ngram);
fail("ConjunctionSolrSpellChecker should have thrown an exception about non-identical StringDistances.");
} catch (IllegalArgumentException iae) {
// correct behavior
}
}
Aggregations