0

I'm using Solr 1.4 and Tomcat6. DB mysql 5.1 store data latin. when i run dataimporthandler this data => view data in solr admin error font.

<doc>
<str name="id">295</str>
<str name="subject">Tuấn Tú</str>
−
...<arr name="title">
<str>tunt721</str>
</arr>
</doc>

True data view :

<doc>
<str name="id">295</str>
<str name="subject">Tuấn Tú</str>
−
...<arr name="title">
<str>tunt721</str>
</arr>
</doc>

help me fix problem. Many thanks

2 Answers 2

1

You could try changing the unicode setting in your datasource to false:

 <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://host/databasename?zeroDateTimeBehavior=convertToNull&amp;useUnicode=false"
    encoding="iso-8859-1"
    user="username"
    password="password" />

A better solution would be to try and convert your database to unicode/UTF8 characterset.

0

A late answer, but if you can't change the db encoding, you could also consider the characterSetResults parameter which tells the server what encoding to return (see miscellaneous in connector docs)

       <dataSource type="JdbcDataSource" 
          driver="com.mysql.jdbc.Driver" 
          url="jdbc:mysql://xxx/yyy"
          user="username"
          characterSetResults="iso-8859-1"
          zeroDateTimeBehavior="convertToNull"
          password="password"
          batchSize="-1" />

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .