Couple of possibilities:

1> The data in Solr is fine. However, your browser is getting the
proper characters back but is not set up to handle the proper
character set so displays ????.

2> Your servlet container is not set up (either inbound or outbound)
to handle the character set you're sending it.


Best,
Erick

On Fri, May 23, 2014 at 3:18 AM, anarchos78
<rigasathanasio...@hotmail.com> wrote:
> Hi,
>
> I'm trying to index data from mysql. The indexing  is successful. Then I
> tried to use the mysql concat function (data-config.xml) in order to
> concatenate a custom string with a field like this: *CONCAT('(',
> CAST('ΤΜΗΜΑ' AS CHAR CHARACTER SET utf8), ' ', apofasi_tmima, ')') *. The
> custom string ('ΤΜΗΜΑ') in Greek. Then when I try to query the field solr
> returns "?????" instead of "ΤΜΗΜΑ". I have also use this: *CONCAT('(',
> 'ΤΜΗΜΑ', ' ', apofasi_tmima, ')')* with no success.
> The "data-config.xml" file is utf-8 encoded and at the beginning there is
> the "<?xml version="1.0" encoding="UTF-8"?>" xml directive. I have also
> tried to set in the dataSource url “characterEncoding=utf8” but indexing
> fails.
> What am I missing here? Is there any workaround for this?
> Below is a snippet from data-config.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <dataConfig>
>    <dataSource type="JdbcDataSource" autoCommit="true" batchSize="-1"
> convertType="false" driver="com.mysql.jdbc.Driver"
> url="jdbc:mysql://127.0.0.1:3306/apofaseis?zeroDateTimeBehavior=convertToNull"
> user="root" password="xxxx" name="db" />
>    <dataSource name="fieldReader" type="FieldStreamDataSource" />
>   <document>
>
>   <entity name=" apofaseis _2000 "
>         dataSource="db"
>         transformer="HTMLStripTransformer"
>         query="select id, CONCAT_WS('', CONCAT(apofasi_number, '/',     
> apofasi_date,
> ' ', (CASE apofasi_tmima WHEN NULL THEN '' WHEN '' THEN '' ELSE CONCAT('(',
> CAST('ΤΜΗΜΑ' AS CHAR CHARACTER SET utf8), ' ', apofasi_tmima, ')') END))) AS
> grid_title, CAST(CONCAT_WS('_',id,model) AS CHAR) AS solr_id,
> apofasi_number, apofasi_date, apofasi_tmima, CONCAT(IFNULL(apofasi_thema,
> ''), ' ', IFNULL(apofasi_description, ''), ' ', apofasi_body) AS content,
> type, model, url, search_tag, last_modified, CONCAT_WS('',
> CONCAT(apofasi_number, '/',     apofasi_date,   ' ', (CASE apofasi_tmima WHEN 
> NULL
> THEN    '' WHEN '' THEN '' ELSE CONCAT('(', CAST('ΤΜΗΜΑ' AS CHAR CHARACTER SET
> utf8), ' ', apofasi_tmima, ')') END))) AS title from apofaseis _2000 where
> type = 'text'"
> ...
> ...
>
>
> Regards,
> anarchos78
>
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Import-data-from-Mysql-concat-issues-tp4137814.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to