我正在使用ElasticSearch 8.7.0,但无法解决更新错误

zsohkypk  于 7个月前  发布在  ElasticSearch
关注(0)|答案(1)|浏览(58)

我在ElasticSearch 8.7.0中更新时收到失败响应,但我不知道解决方案。
它是由以下句子创建的。
curl -XPOST http://localhost:9200/classes/_doc/1-H“Content-Type:application/json”-d '{“title”:“Algrithm”,“professor”:“John”}'
当我搜索时,我得到了很好的结果。
curl -XGET http://localhost:9200/classes/_doc/1?pretty
{“_index”:“_id”:“1”,“_version”:7,“_seq_no”:7,“_primary_term”:2,“找到”:true,“_source”:{“title”:“Algrithm”,“professor”:“John”} }
我想在这里添加学分,所以我更新了它,但我收到了一个失败的响应。
curl -XPOST http://localhost:9200/classes/_doc/1/_update?pretty-H'Content-Type:application/json' -d '{“doc”:{“unit”:1}}'

{“error”:“no handler found for uri [/classes/_doc/1/_update?pretty] and method [POST]”}

Maven们请帮帮忙......我想解决这个睡觉~
Maven们请帮帮忙......我想解决这个睡觉~

vwkv1x7d

vwkv1x7d1#

你需要像这样运行update

_update goes here
                                             |
                                             v
curl -XPOST http://localhost:9200/classes/_update/1?pretty -H'Content-Type: application/json' -d '{"doc":{"unit":1}}'

字符串

相关问题