You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ElasticSearch 8.7.0更新文档报错求助:找不到URI处理程序

Elasticsearch 8.7.0 更新文档报错 "no handler found for uri" 的解决办法

你的更新请求报错是因为URL路径格式错误,Elasticsearch的_update API并不支持/{index}/_doc/{id}/_update这种路径,正确的端点路径应该是/{index}/_update/{id}。

正确的增量更新命令

使用以下curl命令执行增量更新(仅添加/修改指定字段):

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

验证更新结果

执行完更新后,用原查询命令确认字段是否添加成功:

curl -XGET http://localhost:9200/classes/_doc/1?pretty

正常情况下,返回的_source字段会包含新增的"unit":1,且_version数值会比之前递增1。

补充:全量更新的替代方式

如果你想通过_doc端点更新,需要使用PUT请求进行全量替换(必须包含所有原有字段,否则未提及的字段会被删除):

curl -XPUT http://localhost:9200/classes/_doc/1?pretty -H "Content-Type: application/json" -d '{"title":"Algrithm", "professor":"John", "unit":1}'

内容的提问来源于stack exchange,提问作者Dennis Chae

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 14:05:55