You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Stefan Oestreicher (JIRA)" <ji...@apache.org> on 2008/08/13 11:34:50 UTC

[jira] Created: (SOLR-694) error message is misleading when there is no queryconverter defined

error message is misleading when there is no queryconverter defined
-------------------------------------------------------------------

                 Key: SOLR-694
                 URL: https://issues.apache.org/jira/browse/SOLR-694
             Project: Solr
          Issue Type: Improvement
          Components: spellchecker
    Affects Versions: 1.3
            Reporter: Stefan Oestreicher
            Priority: Trivial


the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
But if there are no query converters defined this message is quite misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-694) error message is misleading when there is no queryconverter defined

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622146#action_12622146 ] 

Shalin Shekhar Mangar commented on SOLR-694:
--------------------------------------------

Better yet, go for sane defaults.

If no QueryConverter is defined in the configuration then log a warning and use the SpellingQueryConverter (the only one supplied by Solr as of now).

> error message is misleading when there is no queryconverter defined
> -------------------------------------------------------------------
>
>                 Key: SOLR-694
>                 URL: https://issues.apache.org/jira/browse/SOLR-694
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Priority: Trivial
>
> the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
> But if there are no query converters defined this message is quite misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-694) Use SpellingQueryConverter as default if there is no queryconverter defined

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-694:
---------------------------------------

    Fix Version/s: 1.3
         Assignee: Shalin Shekhar Mangar
      Description: 
the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
But if there are no query converters defined this message is quite misleading.

Use the SpellingQueryConverter as the default if none are defined in the configuration instead of a misleading error message.

  was:
the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
But if there are no query converters defined this message is quite misleading.

          Summary: Use SpellingQueryConverter as default if there is no queryconverter defined  (was: error message is misleading when there is no queryconverter defined)

> Use SpellingQueryConverter as default if there is no queryconverter defined
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-694
>                 URL: https://issues.apache.org/jira/browse/SOLR-694
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Assignee: Shalin Shekhar Mangar
>            Priority: Trivial
>             Fix For: 1.3
>
>         Attachments: SOLR-694.patch
>
>
> the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
> But if there are no query converters defined this message is quite misleading.
> Use the SpellingQueryConverter as the default if none are defined in the configuration instead of a misleading error message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-694) error message is misleading when there is no queryconverter defined

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-694:
---------------------------------------

    Attachment: SOLR-694.patch

Uses SpellingQueryConverter as the default if no queryConverters are defined in configuration.

> error message is misleading when there is no queryconverter defined
> -------------------------------------------------------------------
>
>                 Key: SOLR-694
>                 URL: https://issues.apache.org/jira/browse/SOLR-694
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Priority: Trivial
>         Attachments: SOLR-694.patch
>
>
> the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
> But if there are no query converters defined this message is quite misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-694) error message is misleading when there is no queryconverter defined

Posted by "Stefan Oestreicher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622159#action_12622159 ] 

Stefan Oestreicher commented on SOLR-694:
-----------------------------------------

here's a patch

### Eclipse Workspace Patch 1.0
#P solr
Index: src/java/org/apache/solr/handler/component/SpellCheckComponent.java
===================================================================
--- src/java/org/apache/solr/handler/component/SpellCheckComponent.java	(revision 685498)
+++ src/java/org/apache/solr/handler/component/SpellCheckComponent.java	(working copy)
@@ -54,6 +54,7 @@
 import org.apache.solr.spelling.IndexBasedSpellChecker;
 import org.apache.solr.spelling.QueryConverter;
 import org.apache.solr.spelling.SolrSpellChecker;
+import org.apache.solr.spelling.SpellingQueryConverter;
 import org.apache.solr.spelling.SpellingResult;
 import org.apache.solr.util.RefCounted;
 import org.apache.solr.util.plugin.NamedListPluginLoader;
@@ -290,6 +291,13 @@
               new NamedListPluginLoader<QueryConverter>("[solrconfig.xml] " + xpath, queryConverters);

       loader.load(solrConfig.getResourceLoader(), nodes);
+
+      //ensure that there is at least one query converter defined
+      if (queryConverters.size() == 0) {
+    	  LOG.warning("no queryConverter defined, using default converter");
+    	  queryConverters.put("queryConverter", new SpellingQueryConverter());
+      }
+
       //there should only be one
       if (queryConverters.size() == 1) {
         queryConverter = queryConverters.values().iterator().next();


> error message is misleading when there is no queryconverter defined
> -------------------------------------------------------------------
>
>                 Key: SOLR-694
>                 URL: https://issues.apache.org/jira/browse/SOLR-694
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Priority: Trivial
>
> the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
> But if there are no query converters defined this message is quite misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-694) Use SpellingQueryConverter as default if there is no queryconverter defined

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar resolved SOLR-694.
----------------------------------------

    Resolution: Fixed

Committed revision 685512.

Thanks Stefan!

> Use SpellingQueryConverter as default if there is no queryconverter defined
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-694
>                 URL: https://issues.apache.org/jira/browse/SOLR-694
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Assignee: Shalin Shekhar Mangar
>            Priority: Trivial
>             Fix For: 1.3
>
>         Attachments: SOLR-694.patch
>
>
> the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
> But if there are no query converters defined this message is quite misleading.
> Use the SpellingQueryConverter as the default if none are defined in the configuration instead of a misleading error message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (SOLR-694) error message is misleading when there is no queryconverter defined

Posted by "Stefan Oestreicher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622159#action_12622159 ] 

dlx edited comment on SOLR-694 at 8/13/08 3:35 AM:
------------------------------------------------------------------

here's a patch

{noformat}
### Eclipse Workspace Patch 1.0
#P solr
Index: src/java/org/apache/solr/handler/component/SpellCheckComponent.java
===================================================================
--- src/java/org/apache/solr/handler/component/SpellCheckComponent.java	(revision 685498)
+++ src/java/org/apache/solr/handler/component/SpellCheckComponent.java	(working copy)
@@ -54,6 +54,7 @@
 import org.apache.solr.spelling.IndexBasedSpellChecker;
 import org.apache.solr.spelling.QueryConverter;
 import org.apache.solr.spelling.SolrSpellChecker;
+import org.apache.solr.spelling.SpellingQueryConverter;
 import org.apache.solr.spelling.SpellingResult;
 import org.apache.solr.util.RefCounted;
 import org.apache.solr.util.plugin.NamedListPluginLoader;
@@ -290,6 +291,13 @@
               new NamedListPluginLoader<QueryConverter>("[solrconfig.xml] " + xpath, queryConverters);

       loader.load(solrConfig.getResourceLoader(), nodes);
+
+      //ensure that there is at least one query converter defined
+      if (queryConverters.size() == 0) {
+    	  LOG.warning("no queryConverter defined, using default converter");
+    	  queryConverters.put("queryConverter", new SpellingQueryConverter());
+      }
+
       //there should only be one
       if (queryConverters.size() == 1) {
         queryConverter = queryConverters.values().iterator().next();
{noformat}

      was (Author: dlx):
    here's a patch

### Eclipse Workspace Patch 1.0
#P solr
Index: src/java/org/apache/solr/handler/component/SpellCheckComponent.java
===================================================================
--- src/java/org/apache/solr/handler/component/SpellCheckComponent.java	(revision 685498)
+++ src/java/org/apache/solr/handler/component/SpellCheckComponent.java	(working copy)
@@ -54,6 +54,7 @@
 import org.apache.solr.spelling.IndexBasedSpellChecker;
 import org.apache.solr.spelling.QueryConverter;
 import org.apache.solr.spelling.SolrSpellChecker;
+import org.apache.solr.spelling.SpellingQueryConverter;
 import org.apache.solr.spelling.SpellingResult;
 import org.apache.solr.util.RefCounted;
 import org.apache.solr.util.plugin.NamedListPluginLoader;
@@ -290,6 +291,13 @@
               new NamedListPluginLoader<QueryConverter>("[solrconfig.xml] " + xpath, queryConverters);

       loader.load(solrConfig.getResourceLoader(), nodes);
+
+      //ensure that there is at least one query converter defined
+      if (queryConverters.size() == 0) {
+    	  LOG.warning("no queryConverter defined, using default converter");
+    	  queryConverters.put("queryConverter", new SpellingQueryConverter());
+      }
+
       //there should only be one
       if (queryConverters.size() == 1) {
         queryConverter = queryConverters.values().iterator().next();

  
> error message is misleading when there is no queryconverter defined
> -------------------------------------------------------------------
>
>                 Key: SOLR-694
>                 URL: https://issues.apache.org/jira/browse/SOLR-694
>             Project: Solr
>          Issue Type: Improvement
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Stefan Oestreicher
>            Priority: Trivial
>
> the relevant code (org.apache.solr.handler.component.SpellCheckComponent) only checks if the size of the queryConverters map equals 1 and throws a RuntimeException with the message "One and only one queryConverter may be defined" if it does not.
> But if there are no query converters defined this message is quite misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.