Elasticsearch 6.3版本下新增字段
如:给索引index的类型type新增字段name:
POST index/type/_mapping
{
"properties": {
"name":{
"type":"keyword",
"doc_values":false,
"norms": false
}
}
}注:也可以用PUT。
在嵌套节点下面新增字段,mapping正常写:
PUT index/type/_mapping
{
"properties": {
"channelTradeNo": {
"type": "keyword",
"norms": false,
"doc_values": false
},
"orderDetails": {
"type": "nested",
"properties": {
"rightsStatus": {
"type": "keyword",
"norms": false,
"doc_values": false
},
"rightsCurrTime": {
"type": "keyword",
"norms": false,
"doc_values": false
},
"rightsEndTime": {
"type": "keyword",
"norms": false,
"doc_values": false
}
}
}
}
}
本文介绍如何在Elasticsearch 6.3版本中为指定索引和类型的文档新增字段,并展示了如何在嵌套节点下添加字段的具体操作。
1659

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



