Elasticsearch 增加字段前,首先增加mapping,仅对索引中以后的数据生效。
POST http://192.168.208.32:9200/testindex/_mapping/data/
{
"properties": {
"title": {
"index": "analyzed",
"type": "string",
"fields": {
"raw": {
"index": "not_analyzed",
"type": "string"
}
}
}
}
}
本文介绍如何在Elasticsearch中为现有索引增加新字段的方法。通过增加mapping定义来实现,只对后续新增的数据生效。示例展示了如何定义字符串类型的字段及其分析设置。
294

被折叠的 条评论
为什么被折叠?



