Solr - Import date time field from DB -> 2 hours d

2019-07-06 17:06发布

问题:

I'm importing a datetime column (SQLServer) in Solr, and the values is always 2 hours early in solr that in the DB, with full and delta imports.

I have configured jvm with the correct time (in the logs it's show the correct time).

I think I have to configure something in data-config.xml but I can't find any information.

Thanks in advance.

回答1:

You need to convert your date/times into UTC format when you use the data import handler. See this thread on how to do it. AFAIK Solr always expects your dates in UTC format, no matter what the timestamp of the JVM is. Ditto for when you retrieve and display the date (it will be UTC).



标签: import solr