gpt4 book ai didi

curl - PUT:使用elasticsearch找不到命令

转载 作者:行者123 更新时间:2023-12-02 22:43:54 24 4
gpt4 key购买 nike

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

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

我的终端提示此错误

PUT: command not found



请指导我我缺少什么技巧?

最佳答案

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" ]
}'
  • http://curl.haxx.se/docs/manpage.html
  • http://www.elasticsearchtutorial.com/elasticsearch-in-5-minutes.html
  • 关于curl - PUT:使用elasticsearch找不到命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27322142/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com