“error” : “no handler found for uri [/test1/_doc/1/update?pretty=true] and method [POST]或者[GET]”
一、GET报错原因:type被弃用!
PUT /test1/type/1
{
"name":"李华",
"age":18
}
报错:
"error" : "no handler found for uri [/test1/type/1?pretty=true] and method [PUT]"
解决办法:将type修改为_doc,默认的数据类型
PUT /test1/_doc/1
{
"name":"李华",
"age":18
}
PUT创建新的索引成功
{
"_index" : "test1",
"_id" : "1",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}
二、POST报错原因:语法更新,原来的语法有可能是错的
POST /test1/_doc/1/_update
{
"doc":{
"name":"肖肖"
}
}
报错:
"error" : "no handler found for uri [/test1/_doc/1/update?pretty=true] and method [POST]
解决办法:文章来源:https://www.toymoban.com/news/detail-522616.html
POST /test1/_update/1/
{
"doc":{
"name":"肖肖"
}
}
成功修改更新:文章来源地址https://www.toymoban.com/news/detail-522616.html
{
"_index" : "test1",
"_id" : "1",
"_version" : 2,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 1
}
到了这里,关于“error“ : “no handler found for uri [/test1/_doc/1/update?pretty=true] and method [POST]或者[GET]“的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!