结论: 没有什么不能够.
1.若是数据字段不在mapping里,则动态会更新mapping.
2.数据字段数也能够小于mapping里字段数app
DELETE /lib2 PUT /lib2 { "settings": { "number_of_shards": 2, "number_of_replicas": 1 }, "mappings": { "user": { "properties":{ "name":{"type":"keyword"}, "age":{"type":"integer"}, "address":{"type":"text"}, "birth":{"type":"date"} } } } } GET /lib2/_mapping
PUT /lib2/user/1 { "name":"maotai1", "age":21, "address":"shan xi xian", "birth":"2018-02-06T06:22:59.00Z" }
PUT /lib2/user/2 { "name":"maotai2", "age":22 }
PUT /lib2/user/3 { "name":"maotai3", "age":23, "address":"shan xi xian", "birth":"2018-02-06T06:22:59.00Z", "favor":["book","sleep"] }
GET /lib2/user/_search { "query": { "match_all": {} } }
mapping字段数 == 数据字段数
code
mapping字段数 >= 数据字段数
blog
mapping字段数 <= 数据字段数
date