no handler found for uri [<index>/_doc/<document_id>/_update] and method [POST]

huangapple go评论74阅读模式
英文:

no handler found for uri [<index>/_doc/<document_id>/_update] and method [POST]

问题

目前,我正在使用客户端go-elasticsearch版本v7.8.0和版本为8.1.2的Elasticsearch。Elasticsearch已从版本7.x升级。

现在,当我尝试更新文档时,出现以下错误。

我找到了一些类似于这个的stackoverflow答案,但没有帮助。

https://stackoverflow.com/questions/70334754/api-platform-produces-error-no-handler-found-for-uri-index-doc-search-and

更新失败时Elasticsearch的响应- {"error":"no handler found for uri [/<index>/_doc/<doc_id>/_update?retry_on_conflict=2] and method [POST]"

更新的示例查询:

{"doc":{"info":{"description":"测试描述","slug":"test"}}}

英文:

Currently, i am using client go-elasticsearch version v7.8.0 and elastic of version 8.1.2. the elastic search got updated from version 7.x

Now when I try to update the document it fails with the following error.

There are some stackoverflow answer i came through like this one but didn't help

https://stackoverflow.com/questions/70334754/api-platform-produces-error-no-handler-found-for-uri-index-doc-search-and

elasticsearch response on failure while updating- {&quot;error&quot;:&quot;no handler found for uri [/&lt;index&gt;/_doc/&lt;doc_id&gt;/_update?retry_on_conflict=2] and method [POST]&quot;

Sample query for update:

{&quot;doc&quot;:{&quot;info&quot;:{&quot;description&quot;:&quot;test description&quot;,&quot;slug&quot;:&quot;test&quot;}}}

答案1

得分: 1

您不能使用Go客户端7.8.0与Elasticsearch服务器8.1.2,它们不兼容。您需要将Go客户端升级到相同的8.1版本

英文:

You cannot use a Go client for 7.8.0 with and Elasticsearch server 8.1.2, they are not compatible. You need to upgrade your Go client to the same 8.1 version

答案2

得分: 1

请尝试使用/{index}/_update/{id}端点替代。您使用的那个已被弃用,并在8.1版本中移除。

参考链接:

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html#docs-update-api-request

英文:

Please try use the endpoint /{index}/_update/{id} instead. The one you used is deprecated and removed in 8.1.

Reference:

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html#docs-update-api-request

huangapple
  • 本文由 发表于 2022年4月10日 06:36:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/71812420.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定