2014-12-05 28 views
1

我是ElasticSearch的新手,我正在關注其官方網站上的指南。 當我試圖速記語法指南中提供即PUT:使用elasticsearch找不到命令

PUT /megacorp/employee/1 
{ 
    "first_name" : "John", 
    "last_name" : "Smith", 
    "age" :  25, 
    "about" :  "I love to go rock climbing", 
    "interests": [ "sports", "music" ] 
} 

我的終端給出了這樣的錯誤

PUT:找不到命令

請指導我,我缺少的是什麼把戲?

回答

6

PUT是不是一個命令,你需要使用像捲曲,試試這個:

curl -PUT http://localhost:9200/megacorp/employee/1 -d ' 
{ 
    "first_name" : "John", 
    "last_name" : "Smith", 
    "age" :  25, 
    "about" :  "I love to go rock climbing", 
    "interests": [ "sports", "music" ] 
}' 
+0

它工作正常,但作爲官方指南中提到我們可以使用像** PUT/megacorp/employee/1 **這樣的速記格式,而不是使用捲曲的整個語句,這對我不起作用 – 2014-12-06 08:20:59