ES、kibana安装及交互操作
一、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/_all PUT 创建索引-test localhost:9200/test DEL 删除索引-test localhost:9200/test PUT 创建索引-person-1 localhost:9200/person PUT 新增数据-person-1 localhost:9200/person/_doc/1 { "first_name" : "John", "last_name" : "Smith", "age" : 25, "about" : "I love to go rock climbing", "interests" : [ "sports", "music" ] } PUT 新增数据-person-2 localhost:9200/person/_doc/2 { "first_name" : "Eric", "last_name" : "Smith", "age" : 23, "about" : "I love basketball", "interests" : [ "sports", "reading" ] } GET 搜索数据-person-id localhost:9200/person/_doc/1 GET 搜索数据-person-name localhost: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的时候为或的关系
优秀不够,你是否无可替代
软件测试交流QQ群:721256703,期待你的加入!!
欢迎关注我的微信公众号:软件测试君

【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库