一、创建
语法:
PUT /索引库名称/_mapping/类型名称 { "properties": { "字段名": { "type": 类型,可以是text、keyword、long、short、date、integer、object等
"index": 是否索引,默认为true
"store": 是否存储,默认为false
"analyzer": 分词器 } } }
注意:text与keyword均为字符串类型,其中text为可分词,keyword为不可分词
示例:创建映射,类型名为goods
二、查看
语法:
GET /索引库名称/_mapping
示例:查看所有映射配置