
ES、kibana安装及交互操作
发布日期:2021-05-09 04:59:15
浏览次数:16
分类:博客文章
本文共 2489 字,大约阅读时间需要 8 分钟。
一、ES的安装与启动
1、ES安装(Windows环境)
- 下载地址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch
- 版本:6.3.2
- 运行环境:jdk1.8以上
- 双击.bat启动
2、查看效果
浏览器输入:http://localhost:9200,返回如下json。
{ "name" : "RDFnj43", "cluster_name" : "elasticsearch", "cluster_uuid" : "X-h3NABsTPOitRIeqIJj4Q", "version" : { "number" : "6.3.2", "build_flavor" : "default", "build_type" : "zip", "build_hash" : "053779d", "build_date" : "2018-07-20T05:20:23.451332Z", "build_snapshot" : false, "lucene_version" : "7.3.1", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search"}
证明启动成功
二、kibana安装及启动
1、kibana安装(Windows环境)
- 下载地址:https://www.elastic.co/cn/downloads/past-releases#kibana
- 版本:6.3.2
- 运行环境:jdk1.8以上
- 双击.bat启动
2、查看效果
浏览器输入:http://localhost:5601,如下所示,证明启动成功
三、交互操作
1、ES与mysql的对应关系理解
2、使用postman与ES交互操作案例
Get 查看所有索引localhost:9200/_allPUT 创建索引-testlocalhost:9200/test DEL 删除索引-testlocalhost:9200/test PUT 创建索引-person-1localhost:9200/personPUT 新增数据-person-1localhost:9200/person/_doc/1{ "first_name" : "John", "last_name" : "Smith", "age" : 25, "about" : "I love to go rock climbing", "interests" : [ "sports", "music" ]}PUT 新增数据-person-2localhost:9200/person/_doc/2{ "first_name" : "Eric", "last_name" : "Smith", "age" : 23, "about" : "I love basketball", "interests" : [ "sports", "reading" ]}GET 搜索数据-person-idlocalhost:9200/person/_doc/1GET 搜索数据-person-namelocalhost:9200/person/_doc/_search?q=first_name:john{ "took": 56, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 1, "relation": "eq" }, "max_score": 0.6931472, "hits": [ { "_index": "person", "_type": "_doc", "_id": "1", "_score": 0.6931472, "_source": { "first_name": "John", "last_name": "Smith", "age": 25, "about": "I love to go rock climbing", "interests": [ "sports", "music" ] } } ] }}
- GET为查询操作
- PUT为创建索引
- DELETE为删除索引
3、使用kibana与ES交互操作
找到dev tools,进行交互操作
//查询所有的索引GET _all1 //按照id查询 GET person/_doc/2
与es交互式操作格式:
POST /person/_search{ "query": { "bool": { "must": [ { "match": { "interests": "FOOTBALL" } }, { "match": { "userName": "ESRC22" } } ] } }}
- must为且的关系
- must处为should的时候为或的关系
发表评论
最新留言
做的很好,不错不错
[***.243.131.199]2025年03月27日 17时06分11秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
idea如何编译maven项目
2019-03-06
Kali安装Docker
2019-03-06
Java 持久化操作之 --XML
2019-03-06
程序员如何提高工作效率
2019-03-06
(转)在ASP.NET 中实现单点登录(利用Cache, 将用户信息保存在服务器缓存中)
2019-03-06
RabbitMQ核心概念篇
2019-03-06
权限管理系统系列之序言
2019-03-06
Java程序员学习Go指南(终)
2019-03-06
Go语言实现布谷鸟过滤器
2019-03-06
Mysql多数据库备份
2019-03-06
微信小程序setData子元素
2019-03-06
Docker常用操作
2019-03-06
查看已经开放的端口,查看和清理tomcat日志文件
2019-03-06
Centos7查看外网ip,yum安装的curl无法正常使用
2019-03-06
TX锁处理
2019-03-06
DG_数据文件转换参数测试
2019-03-06