ES更新mapping-新增字段
在elasticsearch的索引创建之后,mapping中已经存在的字段不可以修改其定义,但是可以新增字段。新增方式如下:方式1:使用postman操作方式2:使用kibana的开发者工具操作PUT test/_mapping { "properties": { "text": {"type": "text"}, "flag": {"type": "text", "analyzer": "key
·
在elasticsearch的索引创建之后,mapping中已经存在的字段不可以修改其定义,但是可以新增字段。新增方式如下:
方式1:使用postman操作
方式2:使用kibana的开发者工具操作
PUT test/_mapping { "properties": { "text": {"type": "text"}, "flag": {"type": "text", "analyzer": "keyword"} } }
方式3:使用curl操作
curl -X PUT "localhost:9200/test/_mapping?pretty" -H 'Content-Type: application/json' -d'
{
"properties": {
"alarm_tag_times": {"type": "keyword"},
"alarmTagTimes": {"type": "alias", "path": "alarm_tag_times"},
"flag": {"type": "text"}
}
}
'
更多推荐
已为社区贡献3条内容
所有评论(0)