ES elasticsearch 异常报错:Invalid UTF-8 middle byte

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,
保存后,把后缀修改为需要的后缀。

万事大吉

你可能感兴趣的:(数据库)