我正在使用 Windows 并且REST API
已经安装了附件插件,重新启动elasticsearch
并attachment
为_mapping
. 但是,我收到一个错误:
我执行了这个:(不工作)
{
http://localhost:9200/documentsx/person/1(post)
}
{
"my_attachment" : {
"_content_type" : "application/pdf",
"_name" : "/sap1.pdf",
"content" : "... base64 encoded attachment ..."
}
}
我收到此错误::
{
"error": "MapperParsingException[failed to parse]; nested: JsonParseException[Failed to decode VALUE_STRING as base64 (MIME-NO-LINEFEEDS): Illegal white space character (code 0x20) as character #3 of 4-char base64 unit: can only used between units\n at [Source: [B@16dd7aa; line: 5, column: 29]]; ",
"status": 400
}
顺便说一句,如果我删除文件或在上面放一些随机文件名_name
会给出相同的错误,我认为它不是在读取文件本身。我哪里错了?