28 Aug 2018
mapping是一个定义文档和它包含的fields如何存储和索引的处理过程。例如:
text, keyword, date, long, double, boolean or ip.object, nested.geo_point, geo_shape or completion.PUT my_index
{
"mappings": {
"doc": {
"properties": {
"title": { "type": "text" },
"name": { "type": "text" },
"age": { "type": "integer" },
"created": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}
}
}
现存的mapping无法被更新,只能是重新创建一个新的index,配置新的mapping规则,然后把老的数据reindex过来。