增加映射
创建索引并增加索引映射,请求:
PUT secisland3
{
"mappings": {
"properties": {
"message":{
"type": "text"
},
"city":{
"type": "keyword"
}
}
}
}
返回:
{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "secisland3"
}
索引已存在,增加映射并新增字段create_time:
请求:
PUT secisland3/_mappings
{
"properties": {
"message":{
"type": "text"
},
"city":{
"type": "keyword"
},
"create_time

本文档介绍了如何在ElasticSearch7中进行映射管理,包括增加映射、获取映射及获取映射字段的详细步骤。例如,创建索引secisland3,并设置message字段为text类型,city字段为keyword类型,之后添加create_time字段为date类型。通过GET请求可获取特定映射或字段信息。
最低0.47元/天 解锁文章
1092





