【发布时间】:2015-08-31 20:41:33
【问题描述】:
我有一个 json 文档,我想对其进行索引。
但是当我尝试索引文件时,我总是得到一个错误。
我的json文件名为file.json---
{
"_index": "myIndex",
"_type": "myType",
"_id": "p1486f499782beb828d870f4a92831720e048514f",
"_score": 14.609365,
"_source": {
"content": "When we hear the word summer we think of beaches, sun tans and tiny bikinis. What we ",
"source": "hello.com",
"type": "sports",
"guid": "p1486f499782beb828d870f4a92831720e048514f",
"language": "en"
}
}
我试图像这样索引 json 文件 ---
curl -XPOST 'localhost:9200/myIndex/myType' -d @file.json
{"error":"RemoteTransportException[[Klaatu][inet[/192.168.1.127:9300]][indices:data/write/index]]; 嵌套:MapperParsingException[解析失败,文档为空]; ","状态":400}
我也试过这样----
curl -s -XPOST localhost:9200/_bulk --data-binary @file.json
{"error":"ElasticsearchParseException[派生失败 xcontent]","status":400}
我怎样才能索引我的文档,任何人都知道如何解决这个问题!
【问题讨论】:
标签: json elasticsearch