ES elasticsearch 異常報錯:Invalid UTF-8 middle byte
報錯
Invalid UTF-8 middle byte 0x74\n at
[Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@714a2900; line: 1, column: 4]
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse [content]"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse [content]",
"caused_by": {
"type": "json_parse_exception",
"reason": "Invalid UTF-8 middle byte 0xc0\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@3807cda; line: 1, column: 4]"
}
},
"status": 400
}
問題
文件的字符集不是UTF-8的格式
解決
把這個文件用記事本打開,
【另存爲】,
選擇【字符集】爲UTF-8,
保存後,把後綴修改爲需要的後綴。
萬事大吉