我是ElasticSearch的新手,我正在关注其官方网站上的指南。 当我尝试在指南中给出的速记语法,即
PUT /megacorp/employee/1
{
"first_name" : "John",
"last_name" : "Smith",
"age" : 25,
"about" : "I love to go rock climbing",
"interests": [ "sports", "music" ]
}
我的终端发出此错误
PUT:找不到命令
请指导我错过了什么诀窍?
答案 0 :(得分: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" ]
}'