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

插入中文字符报错:

{"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: 2, column: 15]"}},"status":400}

原因:

client端字符编码格式未设置utf-8,设置即可

elasticsearch异常报错:Invalid UTF-8 middle byte_第1张图片

你可能感兴趣的:(elasticsearch)