You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jack Krupansky (JIRA)" <ji...@apache.org> on 2013/01/28 02:53:12 UTC

[jira] [Created] (SOLR-4367) SpellCheckComponent doesn't complain if its spellchecker list is malformed

Jack Krupansky created SOLR-4367:
------------------------------------

             Summary: SpellCheckComponent doesn't complain if its spellchecker list is malformed
                 Key: SOLR-4367
                 URL: https://issues.apache.org/jira/browse/SOLR-4367
             Project: Solr
          Issue Type: Bug
          Components: spellchecker
    Affects Versions: 4.0
            Reporter: Jack Krupansky


The SpellCheckComponent doesn't do any significant validation of whether its input list of spellcheckers is malformed.

For example:

{code}
  <searchComponent name="spellcheckBug" class="solr.SpellCheckComponent">
      <str name="name">other-name</str>
      <str name="classname">solr.FileBasedSpellChecker</str>
      <str name="sourceLocation">SpellDict.txt</str>
  </searchComponent>
{code}

Oops, I forgot to put the "lst" element in there, like:

{code}
  <searchComponent name="spellcheckBug" class="solr.SpellCheckComponent">
    <lst name="spellchecker">
      <str name="name">other-name</str>
      <str name="classname">solr.FileBasedSpellChecker</str>
      <str name="sourceLocation">SpellDict.txt</str>
    </lst>
  </searchComponent>
{code}

But, there was no complaint from Solr.

The code:

{code}
      for (int i = 0; i < initParams.size(); i++) {
        if (initParams.getName(i).equals("spellchecker")) {
        }
     }
{code}

No else.

There is one other param that could be present, "queryAnalyzerFieldType", but any other param name should throw an exception.

The handler I used:

{code}
  <requestHandler name="/spellBug" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="df">name</str>
      <str name="spellcheck">on</str>
      <str name="spellcheck.dictionary">some-name</str>
    </lst>
    <arr name="last-components">
      <str>spellcheckBug</str>
    </arr>
  </requestHandler>
{code}

And the query request:

{code}
curl "http://localhost:8983/solr/spellBug?q=catl&indent=true"
{code}

In this case, the query returned without doing any spellchecking, when an error would be more appropriate.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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