1.创建mapping
curl --location --request PUT '10.121.140.121:9200/nba/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"name": {
"type": "text"
},
"position": {
"type": "keyword"
}
}
}'
返回数据:
{
"acknowledged": true
}
2.获取mapping
curl --location --request GET '10.121.140.121:9200/nba/_mapping'
3.获取所有的mapping
curl --location --request GET '10.121.140.121:9200/_mapping'
4.增加字段
增加country字段
curl --location --request POST '10.121.140.121:9200/nba/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"name": {
"type": "text"
},
"position": {
"type": "keyword"
},
"country":{
"type":"text"
}
}
}'