字符串 - text:用于全文索引,该类型的字段将通过分词器进行分词,最终用于构建索引
字符串 - keyword:不分词,只能搜索该字段的完整的值,只用于条件精准查询
PUT your_index
{
"settings" : {
"number_of_shards": 1,//分片
"number_of_replicas" : 0//副本
},
"mappings" : {
"properties" : {
"item_id" : {
"type" : "keyword",
"index": true
}
}
}
}