On 9/6/2012 6:54 PM, kiran chitturi wrote:
The error i am getting is 'org.apache.solr.common.SolrException: Invalid
Date String: '1345743552'.

  I think it was being saved as a string in DB, so i will use the
DateFormatTransformer.

To go along with all the other replies that you have gotten: I import from MySQL with a unix format date field. It's a bigint, not a string, but a quick test on MySQL 5.1 shows that the function works with strings too. This is how my SELECT handles that field - I have MySQL convert it before it gets to Solr:

from_unixtime(`d`.`post_date`) AS `pd`

When it comes to the character set issues, this is how I have defined the driver in the dataimport config. The character set in the database is utf8.

  <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    encoding="UTF-8"
url="jdbc:mysql://${dataimporter.request.dbHost}:3306/${dataimporter.request.dbSchema}?zeroDateTimeBehavior=convertToNull"
    batchSize="-1"
    user="<removed>"
    password="<removed>"/>

Thanks,
Shawn

Reply via email to