mapping主要是用来定义索引中文档的各个属性,包括:
- 名称,
- 类型,
- 倒排序索引相关设置
1、查看命令
结果如下:
2、新建
命令:
PUT person-temp
{
"mappings" : {
"properties" : {
"id" : {
"type" : "long"
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"postDate" : {
"type" : "date"
},
"createDate" : {
"type" : "date"
},
"user" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
3、修改
无法修改,修改会提示错误:
注意:
如果文档中时间类型定义为String,那么在kibana中不会有时间过滤条件,必须定义为时间类型,