dqjytt
dqjytt

Reputation: 41

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

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?

Upvotes: 3

Views: 715

Answers (1)

Alexandre Rafalovitch
Alexandre Rafalovitch

Reputation: 9789

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

Upvotes: 3

Related Questions