[
https://issues.apache.org/jira/browse/SOLR-2848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134121#comment-13134121
]
James Dyer commented on SOLR-2848:
----------------------------------
Robert,
I think your first suggestion (moving configuration and response formatting out
of the *SolrSpellCheck) is desirable and doable, but I wanted to keep this
issue focused on increasing test coverage and to make DirectSolrSpellChecker
mirror what AbstractLuceneSpellChecker already does so that it can pass.
Obviously, if every SpellChecker plug-in implemented or extended something that
had a "getStringDistance" or "getAccuracy" method then we wouldn't need to do
instanceof and cast. Once again, a big structural change like this seems
inappropriate in a bug fix, especially as we are not introducing these checks
for the first time. This is a long-standing problem.
It looks to me like "internal levenshtein" is just a dummy class designed to
technically meet the api requirements while not actually doing anything. But
SpellCheckComponent.finishStage() needs to be able to get the StringDistance
impl that was used to generate suggestions during the first stage, then
re-compute distances using its getDistance() method. This is how it can know
how to order the varying suggestions from multiple shards after-the-fact. I
see from the notes in DirectSpellChecker that using the "internal"
StringDistance yields performance improvements over using a pluggable s.d. I
did not look enough to determine if "internal levenshtein" could be modified to
re-compute these internally-generated distance calculations and be usable
externally, without sacrificing the performance gain. If possible, this would
probably be our best bet, eliminating the Exception hack and any possible
discrepancies using 2 different s.d. classes would cause. Do you agree?
> DirectSolrSpellChecker fails in distributed environment
> -------------------------------------------------------
>
> Key: SOLR-2848
> URL: https://issues.apache.org/jira/browse/SOLR-2848
> Project: Solr
> Issue Type: Bug
> Components: SolrCloud, spellchecker
> Affects Versions: 4.0
> Reporter: James Dyer
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-2848.patch
>
>
> While working on SOLR-2585, it was brought to my attention that
> DirectSolrSpellChecker has no test coverage involving a distributed
> environment. Here I am adding a random element to
> DistributedSpellCheckComponentTest to alternate between the "IndexBased" and
> "Direct" spell checkers. Doing so revealed bugs in using
> DirectSolrSpellChecker in a distributed environment. The fixes here roughly
> mirror those made to the "IndexBased" spell checker with SOLR-2083.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]