创建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

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐