Author: gsingers
Date: Mon Jun 30 11:03:23 2008
New Revision: 672852

URL: http://svn.apache.org/viewvc?rev=672852&view=rev
Log:
Rollback SOLR-609 in favor of getting the defaults from ReqHandler.  Change 
around the config to demonstrate, also updated on the Wiki.

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/example/solr/conf/solrconfig.xml
    
lucene/solr/trunk/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig.xml

Modified: lucene/solr/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=672852&r1=672851&r2=672852&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Mon Jun 30 11:03:23 2008
@@ -446,7 +446,6 @@
 
 37. SOLR-604: If the spellchecking path is relative, make it relative to the 
Solr Data Directory.  (Shalin Shekhar Mangar via gsingers)
 
-38. SOLR-609: SpellCheckComponent now honors defaults.  (Shalin Shekhar Mangar 
via gsingers)
 
 Other Changes
  1. SOLR-135: Moved common classes to org.apache.solr.common and altered the

Modified: lucene/solr/trunk/example/solr/conf/solrconfig.xml
URL: 
http://svn.apache.org/viewvc/lucene/solr/trunk/example/solr/conf/solrconfig.xml?rev=672852&r1=672851&r2=672852&view=diff
==============================================================================
--- lucene/solr/trunk/example/solr/conf/solrconfig.xml (original)
+++ lucene/solr/trunk/example/solr/conf/solrconfig.xml Mon Jun 30 11:03:23 2008
@@ -491,14 +491,7 @@
 
 
   <searchComponent name="spellcheck" 
class="org.apache.solr.handler.component.SpellCheckComponent">
-    <lst name="defaults">
-      <!-- omp = Only More Popular -->
-      <str name="spellcheck.onlyMorePopular">false</str>
-      <!-- exr = Extended Results -->
-      <str name="spellcheck.extendedResults">false</str>
-      <!--  The number of suggestions to return -->
-      <str name="spellcheck.count">1</str>
-    </lst>
+
     <str name="queryAnalyzerFieldType">textSpell</str>
 
     <lst name="spellchecker">
@@ -528,6 +521,14 @@
   <queryConverter name="queryConverter" 
class="org.apache.solr.spelling.SpellingQueryConverter"/>
 
   <requestHandler name="/spellCheckCompRH" 
class="org.apache.solr.handler.component.SearchHandler">
+    <lst name="defaults">
+      <!-- omp = Only More Popular -->
+      <str name="spellcheck.onlyMorePopular">false</str>
+      <!-- exr = Extended Results -->
+      <str name="spellcheck.extendedResults">false</str>
+      <!--  The number of suggestions to return -->
+      <str name="spellcheck.count">1</str>
+    </lst>
     <arr name="last-components">
       <str>spellcheck</str>
     </arr>

Modified: 
lucene/solr/trunk/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
URL: 
http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/component/SpellCheckComponent.java?rev=672852&r1=672851&r2=672852&view=diff
==============================================================================
--- 
lucene/solr/trunk/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
 (original)
+++ 
lucene/solr/trunk/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
 Mon Jun 30 11:03:23 2008
@@ -136,8 +136,6 @@
   @SuppressWarnings("unchecked")
   protected NamedList initParams;
   
-  @SuppressWarnings("unchecked")
-  protected SolrParams defaults;
 
   /**
    * Key is the dictionary, value is the SpellChecker for that dictionary name
@@ -151,12 +149,6 @@
   public void init(NamedList args) {
     super.init(args);
     this.initParams = args;
-    if (args != null)   {
-      Object o = args.get("defaults");
-      if (o != null && o instanceof NamedList) {
-        defaults = SolrParams.toSolrParams((NamedList)o);
-      }
-    }
   }
 
   @Override
@@ -196,17 +188,14 @@
     }
     if (tokens != null && tokens.isEmpty() == false) {
       if (spellChecker != null) {
-        int count = params.getInt(SPELLCHECK_COUNT, defaults.getInt(
-            SPELLCHECK_COUNT, 1));
+        int count = params.getInt(SPELLCHECK_COUNT, 1);
         boolean onlyMorePopular = params.getBool(SPELLCHECK_ONLY_MORE_POPULAR,
-            defaults.getBool(SPELLCHECK_ONLY_MORE_POPULAR,
-                DEFAULT_ONLY_MORE_POPULAR));
+            DEFAULT_ONLY_MORE_POPULAR);
         boolean extendedResults = params.getBool(SPELLCHECK_EXTENDED_RESULTS,
-            defaults.getBool(SPELLCHECK_EXTENDED_RESULTS, false));
+            false);
         NamedList response = new SimpleOrderedMap();
         IndexReader reader = rb.req.getSearcher().getReader();
-        boolean collate = params.getBool(SPELLCHECK_COLLATE, defaults.getBool(
-            SPELLCHECK_COLLATE, false));
+        boolean collate = params.getBool(SPELLCHECK_COLLATE, false);
         SpellingResult spellingResult = spellChecker.getSuggestions(tokens,
             reader, count, onlyMorePopular, extendedResults);
         if (spellingResult != null) {

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig.xml
URL: 
http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig.xml?rev=672852&r1=672851&r2=672852&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig.xml Mon Jun 30 
11:03:23 2008
@@ -318,14 +318,6 @@
   </requestHandler>
 
   <searchComponent name="spellcheck" 
class="org.apache.solr.handler.component.SpellCheckComponent">
-    <lst name="defaults">
-      <!-- omp = Only More Popular -->
-      <str name="spellcheck.onlyMorePopular">false</str>
-      <!-- exr = Extended Results -->
-      <str name="spellcheck.extendedResults">false</str>
-      <!--  The number of suggestions to return -->
-      <str name="spellcheck.count">1</str>
-    </lst>
     <str name="queryAnalyzerFieldType">lowerfilt</str>
 
     <lst name="spellchecker">
@@ -357,6 +349,14 @@
   <queryConverter name="queryConverter" 
class="org.apache.solr.spelling.SpellingQueryConverter"/>
 
   <requestHandler name="spellCheckCompRH" 
class="org.apache.solr.handler.component.SearchHandler">
+    <lst name="defaults">
+      <!-- omp = Only More Popular -->
+      <str name="spellcheck.onlyMorePopular">false</str>
+      <!-- exr = Extended Results -->
+      <str name="spellcheck.extendedResults">false</str>
+      <!--  The number of suggestions to return -->
+      <str name="spellcheck.count">1</str>
+    </lst>
     <arr name="last-components">
       <str>spellcheck</str>
     </arr>


Reply via email to