2.2.1 增加映射
url:http://192.168.0.108:9200/yingshe/_mapping/user/(前提 索引存在,如索引不存在 请按照上一篇创建索引添加映射)
参数:
{
"properties": {
"message": {
"type": "string"
}
}
}
如果想继续添加映射,则重复上面的操作.
注意不同类型之间的冲突,es的字段信息,如果要更改,那么在该索引下所有这样类型的字段就要全部更改例如:
参数:
{
"properties": {
"text":{
"type":"string",
"index":"not_analyzed"
}
}
}
如果你只更改 单一属性的话,那么就会报错:
参数:
{
"properties": {
"namelist": {
"properties": {
"lage": {
"type": "string","index":"not_analyzed"
}
}
}
}
}
获取字段映射: