Dynamic Template

      将字符串类型映射为keyword

PUT test_template
{
  "mappings": {
       "dynamic_templates":[
        {
          "strings":{
            "match_mapping_type":"string",
            "mapping":{
              "type":"keyword"
            }
         }
       }
      ]
  }
}

  将以message开头的映射为text类型

PUT test_template
{
  "mappings": {
    "dynamic_templates":[
      {
       "message_as_text":{
         "match_mapping_type":"string",
         "match":"message",
         "mapping":{
           "type":"text"
         }
       }
      }
    ]
  }
}

 

posted on 2021-10-12 08:21  溪水静幽  阅读(90)  评论(0)    收藏  举报