You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ko...@apache.org on 2010/10/14 04:18:47 UTC

svn commit: r1022357 - in /lucene/dev/trunk/solr: CHANGES.txt src/java/org/apache/solr/spelling/suggest/Suggester.java src/test/test-files/solr/conf/solrconfig-spellchecker.xml

Author: koji
Date: Thu Oct 14 02:18:47 2010
New Revision: 1022357

URL: http://svn.apache.org/viewvc?rev=1022357&view=rev
Log:
SOLR-2139: Wrong cast from string to float

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java
    lucene/dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1022357&r1=1022356&r2=1022357&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Thu Oct 14 02:18:47 2010
@@ -523,6 +523,8 @@ Bug Fixes
 
 * SOLR-2148: Highlighter doesn't support q.alt. (koji)
 
+* SOLR-2139: Wrong cast from string to float (Igor Rodionov via koji)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java?rev=1022357&r1=1022356&r2=1022357&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java Thu Oct 14 02:18:47 2010
@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.solr.spelling.suggest;
 
 import java.io.File;
@@ -58,7 +75,7 @@ public class Suggester extends SolrSpell
     LOG.info("init: " + config);
     String name = super.init(config, core);
     threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f
-            : (Float) config.get(THRESHOLD_TOKEN_FREQUENCY);
+            : Float.valueOf((String)config.get(THRESHOLD_TOKEN_FREQUENCY));
     sourceLocation = (String) config.get(LOCATION);
     field = (String)config.get(FIELD);
     lookupImpl = (String)config.get(LOOKUP_IMPL);

Modified: lucene/dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml?rev=1022357&r1=1022356&r2=1022357&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml (original)
+++ lucene/dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml Thu Oct 14 02:18:47 2010
@@ -101,6 +101,9 @@
       <str name="lookupImpl">org.apache.solr.spelling.suggest.jaspell.JaspellLookup</str>
       <str name="field">suggest</str>
       <str name="buildOnCommit">true</str>
+
+      <!-- Suggester properties -->
+      <str name="threshold">0.0</str>
 <!--
       <str name="sourceLocation">american-english</str>
 -->