Elasticsearch 插入新字段

在已存在的mapping基础上新增字段

1
2
3
4
5
6
7
8
9
10
11
curl -XPUT 'http://127.0.0.1:9200/demo_index/_mapping/demo?pretty' -H 'Content-Type: application/json' -d
'
{
"properties": {
"name": {
"index": false,
"type": "text"
}
}
}
'
  • demo_index:索引库名indexName
  • demo:索引库分组type
  • name:新增字段名称
  • type:新增字段类型