DIH timezone offset

View: New views
4 Messages — Rating Filter:   Alert me  

DIH timezone offset

by Mike-259 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi I'm importing database records into SOLR using the DIH. My dates are not getting imported correctly and they're getting a timezone offset added to them (+4 hours). I know SOLR tends to be timezone agnostic from the documentation I've read so far, but what could this be?

Any tips on where to look would be greatly appreciated. I'm using the trunk version of SOLR built on 11/1.

Mike

Re: DIH timezone offset

by Noble Paul നോബിള്‍ नोब्ळ्-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DIH relies on the driver to get the date. It does not do any automatic
conversion. Is it possible for the driver to give the date with the
right offset?

On Thu, Nov 5, 2009 at 3:21 AM, Mike <mpilusonews@...> wrote:
> Hi I'm importing database records into SOLR using the DIH. My dates are not getting imported correctly and they're getting a timezone offset added to them (+4 hours). I know SOLR tends to be timezone agnostic from the documentation I've read so far, but what could this be?
>
> Any tips on where to look would be greatly appreciated. I'm using the trunk version of SOLR built on 11/1.
>
> Mike



--
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Parent Message unknown Re: DIH timezone offset

by Mike-259 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"""
DIH relies on the driver to get the date. It does not do any automatic
conversion. Is it possible for the driver to give the date with the
right offset?
"""

I have retried a full-import after setting the Java user.timezone property to UTC and the dates import correctly. I've narrowed down the problem to the way SQL server is returning dates. Converting it to ISO-8601 format resolves the issue, but I had to append a 'Z' at the end of the conversion like so: "select convert(varchar(30),datesentutc,126)+'Z' as date from table".

Hope this is helpful to someone else. Thanks for the help.

Mike




Re: DIH timezone offset

by Noble Paul നോബിള്‍ नोब्ळ्-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

anyone to add this here
http://wiki.apache.org/solr/DataImportHandlerFaq

On Thu, Nov 5, 2009 at 8:35 PM,  <mpilusonews@...> wrote:

> """
> DIH relies on the driver to get the date. It does not do any automatic
> conversion. Is it possible for the driver to give the date with the
> right offset?
> """
>
> I have retried a full-import after setting the Java user.timezone property to UTC and the dates import correctly. I've narrowed down the problem to the way SQL server is returning dates. Converting it to ISO-8601 format resolves the issue, but I had to append a 'Z' at the end of the conversion like so: "select convert(varchar(30),datesentutc,126)+'Z' as date from table".
>
> Hope this is helpful to someone else. Thanks for the help.
>
> Mike
>
>
>
>



--
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com