一、创建索引
{
"mappings":{
"properties":{
"id":{
"type":"text"
},
"name":{
"type":"text"
},
"birthday":{
"type":"date",
"format":"yyyy-MM-dd"
}
}
}
}
二、删除索引
三、添加数据
{
"id":1,
"name":"qfx",
"birthday":"1992-01-07"
}
四、删除数据
五、查询(主键查询)
2、模糊匹配
3、高亮匹配查询结果
{
"query":{
"match":{
"name":"fw"
}
},
"highlight": {
"pre_tags": "<b class='key' style='color:red'>",
"post_tags": "</b>",
"fields": {
"name": {}
}
}
}