如何解决将数据加载到 aws elasticsearch 时出错:RequestError(400, 'no handler found for uri [/:443/movies/_doc/5] and method [PUT]'
我正在尝试使用 python 将数据加载到 AWS elasticsearch
这是我在做的
我已使用 elasticsearch 模块连接到 AWS auth 和 Elasticsearch 服务,并使用 elasticsearch 端点作为主机。
代码如下:
awsauth = AWS4Auth(credentials.access_key,credentials.secret_key,region,service)
es = Elasticsearch(
hosts = [{'host': host,'port': 443}],http_auth = awsauth,use_ssl = True,verify_certs = True,connection_class = Requestshttpconnection
)
document = {
"title": "Moneyball","director": "Bennett Miller","year": "2011"
}
es.index(index="movies",doc_type="_doc",id="5",body=document)
我收到以下错误:
raise HTTP_EXCEPTIONS.get(status_code,TransportError)(
elasticsearch.exceptions.RequestError: RequestError(400,'no handler found for uri [/:443/movies/_doc/5] and method [PUT]','no handler found for
uri [/:443/movies/_doc/5] and method [PUT]')
如何解决这个问题?
还有其他方法可以将数据放入 Elasticsearch 中吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。