动态设置所有string字段不分词

PUT     http://192.168.1.12:9200/test

{
    "settings": {
        "number_of_shards": 3,
        "number_of_replicas": 1
    },
    "mappings": {
        "testdoc": { //type
            "dynamic_templates": [
                {
                    "strings": {
                        "match": "*",
                        "match_mapping_type": "string",
                        "mapping": {
                            "type": "string",
                            "index": "not_analyzed"
                        }
                    }
                }
            ]
        }
    }
}
{
"settings":{"number_of_shards": 3,"number_of_replicas": 1},


"mappings": {
"docase": {
"dynamic_templates": [

{ "strings": {
"match": "*", 
"match_mapping_type": "string",
"mapping": {
"type": "string",
 "fields": {
                "raw": {
                  "type":  "string",
                  "index": "not_analyzed",
                  "ignore_above": 256
                }
              }
}
}}
]
}

} 
}
原文地址:https://www.cnblogs.com/zzt-lovelinlin/p/8328861.html