就相当于定义表的数据结构,字段类型等、
为某个索引新增映射
PUT /nba/_mapping
{
"properties": {
"name": {
"type": "text"
},
"team_name": {
"type": "text"
},
"position": {
"type": "keyword"
},
"play_year": {
"type": "keyword"
},
"jerse_no": {
"type": "keyword"
}
}
}
修改索引的映射
PUT /nba/_mapping
{
"properties": {
"name": {
"type": "text"
},
"team_name": {
"type": "text"
},
"position": {
"type": "keyword"
},
"play_year": {
"type": "keyword"
},
"jerse_no": {
"type": "keyword"
},
"country": {
"type": "keyword"
}
}
}
返回指定的索引的映射
get /nba/_mapping
返回多个索引的映射
get /nba,nbb/_mapping
获取所有索引的映射
GET _mapping
或
GET _all/_mapping