From 7549d04c32ca4e4fbe84625dc0d6fc2e3ac6c68f Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Thu, 11 Dec 2008 08:34:08 +0000 Subject: [PATCH] SOLR-888 -- DateFormatTransformer cannot convert non-string type git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@725618 13f79535-47bb-0310-9956-ffa450edef68 --- contrib/dataimporthandler/CHANGES.txt | 3 +++ .../apache/solr/handler/dataimport/DateFormatTransformer.java | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/dataimporthandler/CHANGES.txt b/contrib/dataimporthandler/CHANGES.txt index b62dc72dc28..b86beeb80d3 100644 --- a/contrib/dataimporthandler/CHANGES.txt +++ b/contrib/dataimporthandler/CHANGES.txt @@ -68,6 +68,9 @@ Bug Fixes 9. SOLR-893: Unable to delete documents via SQL and deletedPkQuery with deltaimport (Dan Rosher via shalin) +10. SOLR-888: DateFormatTransformer cannot convert non-string type + (Amit Nithian via shalin) + Documentation ---------------------- diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java index 93537027151..0def457d041 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java @@ -66,8 +66,7 @@ public class DateFormatTransformer extends Transformer { } aRow.put(column, results); } else { - String value = (String) o; - aRow.put(column, process(value, fmt)); + aRow.put(column, process(o.toString(), fmt)); } } catch (ParseException e) { LOG.warn( "Could not parse a Date field ", e);