缺少索引映射类型

时间:2019-06-10 13:25:51

标签: elasticsearch

从5.6.16迁移到6.8 Elasticsearch之后。转换模板时,出现以下错误。

试图将模板从5.6.16转换为6.8,但出现错误。

{
    "template": "my-events*",
    "mappings": {
        "_doc": {
            "dynamic": "true",
            "dynamic_templates": [{
                "notanalyzed": {
                    "match":              "*",
                    "match_mapping_type": "text",
                    "mapping": {
                        "type": "keyword"
                    }
                }
            }],
            "properties": {
                "appName": {
                    "type": "keyword",
                    "index":  "true"
                },
                "containerID": {
                    "type": "keyword",
                    "index":  "true"
                },
                "event": {
                    "type": "text",
                    "index":  "true"
                },
                "host": {
                    "type": "keyword",
                    "index":  "true"
                },
                "message": {
                    "type": "text"
                },
                "source": {
                    "type": "keyword",
                    "index": "true"
                },
                "tags": {
                    "type": "keyword",
                    "index": "true"
                },
                "type": {
                    "type": "keyword",
                    "index":  "true"
                }
            }
        }
    }
}
curl -XPUT 'http://localhost:9200/my-event/_mapping' -H "Content-Type: application/json" -d @myevent.json
  

{“错误”:{“根本原因”:[{“类型”:“ action_request_validation_exception”,“原因”:“验证   失败:1:映射类型为   丢失;“}],”类型“:” action_request_validation_exception“,”原因“:”验证   失败:1:映射类型丢失;“}”状态“:400}

0 个答案:

没有答案