相关疑难解决方法(0)

Elasticsearch 问题类型移除

我正在尝试使用 Elasticsearch Ver 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)
Run Code Online (Sandbox Code Playgroud)

其次是:

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})
Run Code Online (Sandbox Code Playgroud)

我应该如何修改我的代码以使其(请参阅此处)与 Elasticsearch 7X 版本一致?任何形式的帮助将不胜感激。

elasticsearch

4
推荐指数
1
解决办法
3461
查看次数

标签 统计

elasticsearch ×1