特殊字段(例如
_ttl和)
_timestamp必须在与
properties对象相同的级别上定义:
curl -Xput 'http://elasticsearch:9200/ppe/log/_mapping' -d '{ "log": { "_ttl": { "enabled": true }, "_timestamp": { "enabled": true, "store": "yes" }, "properties": { "message": { "type": "string", "store": "yes" }, "appid": { "type": "string", "store": "yes" }, "level": { "type": "integer", "store": "yes" }, "logdate": { "type": "date", "format": "date_time_no_millis", "store": "yes" } } }}'


