Apach Solr import index from csv(UTF-8) error: und

2019-08-03 12:14发布

问题:

When I try to load data using command from solr documentation:

curl http://localhost:7070/solr/metadataCore/update?commit=true --data-binary @7.csv -H 'Content-type:text/csv; charset=utf-8'

result:

1)If the csv encode is ANSI, it can import/update successfully but it can not support Chinese.

2)if the csv encode is UTF-8, result is error but it always show :undefined field.

The first column in csv is topicType. However the field is clearly defined and what is it with the ? before the field name? How can I load the data?

回答1:

Most probably you run into the Byte Order Mark that some software (especially Microsoft) put right at the start of the text.

You should be able to search for "'your software' export without byte order mark" and you'll find an answer or a workaround. Some editors may also know how to save with or without BOM



标签: csv solr