From 7de1e259f18e5a257a3997f725cb82b6adf21962 Mon Sep 17 00:00:00 2001 From: Erick Erickson Date: Tue, 10 Jan 2012 22:51:17 +0000 Subject: [PATCH] Fix for SOLR-2987 (numeric keys in external file field stopped processing the rest of the file) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1229783 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/solr/search/function/FileFloatSource.java | 3 +-- solr/core/src/test-files/solr/conf/schema11.xml | 4 +++- .../solr/search/function/TestFunctionQuery.java | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java b/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java index 1333254e975..f8361a4b1ec 100755 --- a/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java +++ b/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java @@ -255,10 +255,9 @@ public class FileFloatSource extends ValueSource { String key = line.substring(0, delimIndex); String val = line.substring(delimIndex+1, endIndex); - idType.readableToIndexed(key, internalKey); - float fval; try { + idType.readableToIndexed(key, internalKey); fval=Float.parseFloat(val); } catch (Exception e) { if (++otherErrors<=10) { diff --git a/solr/core/src/test-files/solr/conf/schema11.xml b/solr/core/src/test-files/solr/conf/schema11.xml index c4c932b8c5b..6d5fd1adc5c 100755 --- a/solr/core/src/test-files/solr/conf/schema11.xml +++ b/solr/core/src/test-files/solr/conf/schema11.xml @@ -273,7 +273,7 @@ valued. --> stored="false" indexed="true" class="solr.ExternalFileField" valType="float"/> - @@ -320,6 +320,8 @@ valued. --> + +