Solr 4.5 not saving time correctly

110 views Asked by At

I have defined a date field in the Solr, I'm using DIH to populate value from DB to Solr. InsertTs value in solr always storing either 4:00:00 or 5:00:00 but the date part is stored properly.

Solr Value: 2013-11-07T05:00:00Z or 2015-05-13T04:00:00Z

DB Value: 07-11-13 02:29:53.00 PM or 07-11-13 12:00:00.00 AM

Schema.xml: INSERTTS is defined as type "date"

DIH: name="INSERTTS" column="INSERTTS"

DIH Query: SELECT TO_DATE(TO_CHAR(INSERTTS, 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss') AS INSERTTS FROM EMPLOYEE

InsertTs is defined as TimeStamp in the db.

Solr is Running on Tomcat server in Linux machine. Linux machine is in EDT timezone. DB is Oracle 11g and in UTC timezone.

1

There are 1 answers

0
Chethan C On BEST ANSWER

Issue was with JDBC driver it was not fetching time part from the date field.