elasticsearch-7.9.0 无法从类型 [keyword] 更改为 [text]

标签 elasticsearch kibana

我是elasticsearch的新手。我使用这样的代码创建一个映射:

PUT /my-demo1
{
  "mappings": {
    "properties": {
      "dsu_sn": {
        "type": "keyword"
      },
      "iot_id": {
        "type": "keyword"
      },
      "test_suite_id": {
        "type": "text"
      },
      "error_code": {
        "type": "long"
      }
    }
  }
}
ES 回复 mapper [iot_id] cannot be changed from type [keyword] to [text]当我使用这样的代码索引文档时:
POST /my-demo1/1
{
  "dsu_sn": "ssl123321",
  "iot_id": "550068573720395776",
  "test_suite_id": "com.example.test.wifi",
  "error_code": 2
}

最佳答案

您需要添加 _doc在将文档发布到 Elasticsearch 时的 URL 中,将 URL 更改为 POST /my-demo1/_doc/1引用 removal of types了解更多信息。

关于elasticsearch-7.9.0 无法从类型 [keyword] 更改为 [text],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65031413/

相关文章:

Elasticsearch 错误 : MapperParsingException failed to parse

java - Kibana 查询结果 _count 和 _search api 之间不匹配

elasticsearch - Elasticsearch和Kibana-可视化一年日志的最佳实践

node.js - 如何使用 node.js 设置 ELK

elasticsearch - 在Vega/Vega-lite中绘制漏斗图

elasticsearch - elasticsearch范围上的多重匹配

在 elasticsearch 中过滤 _id 范围

ruby-on-rails - 关于utf8的Tire::Search::SearchRequestFailed错误

elasticsearch - Docker中的Logstash-将2个事件合并为1个事件

elasticsearch - 如果我想让Elasticsearch更快,是否要向集群添加更多节点?