以下错误指出了问题的根源。
Failed to derive xcontent from (offset=0, length=9): [106, 115, 111, 110, 46, 102, 105, 108, 101]
UTF-8代码[106、115、111,…]显示您正在尝试索引字符串“ json.file”而不是文件内容。
要索引文件的内容,只需在文件名前面添加字母“ @”。
curl -X POST "localhost:9200/test/attachment/" -d @json.file



