1、使用postman创建索引
添加 put
2、使用postman设置mapping映射
修改 post
3、使用postman删除索引库
Delete http://127.0.0.1:9200/blog 删除索引为blog
4、向索引库中添加文档
put 或Post
http://localhost:9200/xc_course/doc/4028e58161bcf7f40161bcf8b77c0000
使用postman测试:
{
“name”:“Bootstrap开发框架”,
“description”:“Bootstrap是由Twitter推出的一个前台页面开发框架,在行业之中使用较为广泛。此开发框架包
含了大量的CSS、JS程序代码,可以帮助开发者(尤其是不擅长页面开发的程序人员)轻松的实现一个不受浏览器限制的
精美界面效果。”,
“studymodel”:“201001”
}
5、向索引库中删除文档
delete
http://localhost:9200/xc_course/doc/4028e58161bcf7f40161bcf8b77c0000
6、查询文档
在这里插入图片描述
查询文档使用term查询
http://localhost:9200/discuz put
{
“mappings”: {
“discuz_thread”: {
“properties”: {
“id”: {
“type”: “long”,
“store”: true
},
“title”: {
“type”: “text”,
“store”: true,
“index”: true,
“analyzer”: “ik_max_word”
}
}
}
}
}
中文分词器测试:
curl ‘http://192.168.80.10:9200/zhouls/_analyze?analyzer=ik_max_word&pretty=true’ -d ‘{“text”:“这里是好记性不如烂笔头感叹号的博客园”}’
curl ‘http://192.168.80.10:9200/zhouls/_analyze?pretty=true’ -d ‘{“text”:“这里是好记性不如烂笔头感叹号的博客园”}’