是的,你可以通过创建一个实现这个指标模板上
*有一个
_default_映射类型和动态模板
curl -XPUT localhost:9200/_template/global -d '{ "template": "*", "mappings": { "_default_": { "dynamic_templates": [ { "strings": { "match_mapping_type": "string", "mapping": { "type": "string", "index": "not_analyzed" } } } ] } }}'然后,您可以在任何新索引中创建任何文档,并且所有字符串字段都将为
not_analyzed
curl -XPUT localhost:9200/dummy_index/dummy_type/1 -d '{"name": "dummy"}'如果检查
dummy_type新创建的映射类型,则将
dummy_index看到该
name字段为
not_analyzed



