I am experiencing similar problem related to encoding. In my case, the char
like " (double quote)
is also garbaled.

I believe this is because the encoding in my MySQL table is latin1 and in
the JDBC it is being specified as UTF-8. Is there a way to specify latin1
charset in JDBC? probably that would resolve this.


*Pranav Prakash*

"temet nosce"



On Sat, Sep 8, 2012 at 3:16 AM, Shawn Heisey <s...@elyograg.org> wrote:

> 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