我的elasticsearch对GET请求(如curl -X GET "localhost:9200"
)完全有效。
然而,每当我试图通过post或put添加一些东西时,它都会给我错误。
即使是这个简单的示例文档(我从教程中获得的)也不适合我:
curl -XPUT 'http://localhost:9200/blog/article/1' -d '{"title": "New version of Elasticsearch released!", "content": "Version 2.2 released today!", "priority": 10, "tags": ["announce", "elasticsearch", "release"] }'
这是我得到的错误:
{"error":"no handler found for uri [/blog/article/1] and method [PUT]"}
尽管我确信我的语法是正确的,但我总是得到这种错误
1条答案
按热度按时间ercv8c1e1#
您在URL中使用
article
时使用的是一种类型,该类型已过时很久,不再受支持请查看深入研究此问题的文档-https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html
试试这样东西;