环境:ElasticSearch6.5.4版本,kibana6.5.4版本
首先在kibana的Dev Tools中插入几条数据,未制定mapping,则会默认动态映射
POST /stulib/items/_bulk
{"index": {"_id": 1}}
{"age": 11,"stuID": "STUID10010"}
{"index": {"_id": 2}}
{"age": 12,"stuID": "STUID10011"}
查看mapping:
GET /stulib/_mapping
结果:
{
"stulib" : {
"mappings" : {
"items" : {
"properties" : {
"age" : {
"type" : "long"
},
"stuID" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}}}}}}}}
可观察到stuID使用了分词,意味着stuID的值如果