我试图使用Elasticsearch 7.1在Python中运行以下代码,但是出现以下错误:
ElasticsearchDeprecationWarning: [types removal] Using include_type_name in put mapping requests is deprecated. The parameter will be removed in the next major version.
client.indices.put_mapping(index=indexName,doc_type='diseases', body=diseaseMapping, include_type_name=True)其次是:
ElasticsearchDeprecationWarning: [types removal] Specifying types in document index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, or /{index}/_create/{id}).
client.index(index=indexName,doc_type=docType, body={"name": disease,"title":currentPage.title,"fulltext":currentPage.content})我应该如何修改我的代码以使它(请看这里)与ElasticSearch7X版本一致?任何帮助都会很感激的。
发布于 2020-06-11 12:15:30
现在这只是一个警告,但它将成为Elasticsearch 8中的一个错误。
从上几个版本开始,Elasticsearch就计划删除索引中的索引类型。
我的建议是设计一个应用程序和映射,使其不包括索引中的类型参数
要了解弹性搜索的原因,这里有一个链接:删除
发布于 2020-12-23 03:01:02
此错误消息的一个常见问题(和难以识别)可能是拼写端点错误,例如:
拼写错误:
/search
更正:
/_search
重复检查您的端点是否正确,因为ElasticSearch可能认为您试图操作(添加、更新、删除)一个文档,并提供一个类型,但情况并非如此(您试图调用一个端点)。
https://stackoverflow.com/questions/62322613
复制相似问题