ES 设置 mapping
接着上片说的创建索引 , 接下来需要做的是设置 mapping . 就相当于数据库添加了表之后 , 需要设计各个字段的数据格式
创建 index 之后 , ES 会默认创建 mapping .
查看 mapping
GET /roc_test_index/_mapping
返回结果
{
"roc_test_index": {
"mappings": {
"roc_test_type": {
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}