From 6e638c8460450756e4cff22742bb0e91f9431eb6 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Mon, 8 Jul 2013 11:30:40 +0000 Subject: [PATCH] SOLR-4978: Time is stripped from datetime column when imported into Solr date field if convertType=true git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1500666 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../org/apache/solr/handler/dataimport/JdbcDataSource.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index b6b4d845910..ce1955e074d 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -260,6 +260,9 @@ Bug Fixes * SOLR-4788: Multiple Entities DIH delta import: dataimporter.[entityName].last_index_time is empty. (chakming wong, James Dyer via shalin) +* SOLR-4978: Time is stripped from datetime column when imported into Solr date field + if convertType=true. (Bill Au, shalin) + Optimizations ---------------------- diff --git a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java index b3a0e9c7cd7..41bc126d93b 100644 --- a/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java +++ b/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java @@ -333,7 +333,7 @@ public class JdbcDataSource extends result.put(colName, resultSet.getDouble(colName)); break; case Types.DATE: - result.put(colName, resultSet.getDate(colName)); + result.put(colName, resultSet.getTimestamp(colName)); break; case Types.BOOLEAN: result.put(colName, resultSet.getBoolean(colName));