You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Abhishek Kumar Singh (JIRA)" <ji...@apache.org> on 2017/03/10 15:15:04 UTC

[jira] [Commented] (SOLR-6271) ConjunctionSolrSpellChecker wrong check for same string distance

    [ https://issues.apache.org/jira/browse/SOLR-6271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15905234#comment-15905234 ] 

Abhishek Kumar Singh commented on SOLR-6271:
--------------------------------------------

This issue is still occuring in my case, wherein I'm using _DirectSolrSpellChecker_ and  _FileBasedSpellChecker_ . The problem is that _DirectSolrSpellChecker_ is using *LuceneLavensteinDistance* while  _FileBasedSpellChecker_ is using *LavensteinDistance* as the StringDistance.
This is throwing the   *IllegalArgumentException( "All checkers need to use the same StringDistance.");*  .

What can be the fix to this? 


> ConjunctionSolrSpellChecker wrong check for same string distance
> ----------------------------------------------------------------
>
>                 Key: SOLR-6271
>                 URL: https://issues.apache.org/jira/browse/SOLR-6271
>             Project: Solr
>          Issue Type: Bug
>          Components: spellchecker
>    Affects Versions: 4.9
>            Reporter: Igor Kostromin
>            Assignee: James Dyer
>             Fix For: 5.5
>
>         Attachments: SOLR-6271.patch, SOLR-6271.patch
>
>
> See ConjunctionSolrSpellChecker.java
> try {
>       if (stringDistance == null) {
>         stringDistance = checker.getStringDistance();
>       } else if (stringDistance != checker.getStringDistance()) {
>         throw new IllegalArgumentException(
>             "All checkers need to use the same StringDistance.");
>       }
>     } catch (UnsupportedOperationException uoe) {
>       // ignore
>     }
> In line stringDistance != checker.getStringDistance() there is comparing by references. So if you are using 2 or more spellcheckers with same distance algorithm, exception will be thrown anyway.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org