PUT:使用elasticsearch找不到命令

M.A*_*aqi 1 curl elasticsearch

我是ElasticSearch的新手,我正在关注其官方网站上的指南.当我尝试在指南中给出的速记语法即

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

我的终端给出了这个错误

PUT:找不到命令

请指导我错过哪些技巧?

Dei*_*idy 6

PUT不是命令,你需要使用像curl这样的东西,试试这个:

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" ]
}'
Run Code Online (Sandbox Code Playgroud)