我有一個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
{ 「錯誤」
我的JSON文件---「RemoteTransportException [ [Klaatu] [inet [/ 192.168.1.127:9300]] [indices:data/write/index]]; 嵌套:MapperParsingException [未解析,文檔爲空]; 「,」status「:400}
我還試圖像這樣----
curl -s -XPOST localhost:9200/_bulk --data-binary @file.json
{ 「錯誤」: 「ElasticsearchParseException [未能得到 xcontent]」, 「狀態」:400}
如何索引我的文檔,任何人都知道如何解決這個問題!
@Great :)非常感謝Val :),它的工作原理就像你解釋過的:) –