The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true

龙飞文
2023-12-01

创建es索引模板时报错,因为es7不支持type了,只有一个默认的_doc。

解决方法:在url里设置 include_type_name=true


PUT http://10.10.101.140:30092/_template/testaa?include_type_name=true

{
"order":1,
"index_patterns":["testaa-*"],
"mappings":{
    "_doc":{
   "properties":{
     "middleware_name":{
        "type":"keyword",
        "index":true
     },
     "k8s_pod_namespace":{
        "type":"keyword",
        "index":true
     },
     "query":{
        "type":"text",
        "index":true,
        "analyzer":"ik_max_word"
     }
    }
    }
},
"settings":{
   "index": {
      "max_result_window": "30000000"
    }
}
}

Error create index template in ES 6.7 - Elasticsearch - Discuss the Elastic Stack

 类似资料:

相关阅读

相关文章

相关问答