1,下载elasticsearch和kibana 7.3.2
jdk使用1.8
elasticsearch:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-windows-x86_64.zip
Kibana: https://artifacts.elastic.co/downloads/kibana/kibana-7.3.2-windows-x86_64.zip
https://www.elasticsearch.co/cn/
2,修改es配置
使用单例模式
node.name: node-1
cluster.initial_master_nodes: ["node-1"]
xpack.ml.enabled: false
http.cors.enabled: true
http.cors.allow-origin: /.*/
3,启动es和Kibana
访问elasticsearch:http://localhost:9200/
访问Kibana:http://localhost:5601/
4,使用Kibana进行创建索引,文档
GET _search
{
"query": {
"match_all": {}
}
}
// 创建索引,相当于数据库的表
PUT /music
//创建music索引的一条记录,文档
PUT /music/_doc/1
{
"name":"I love you",
"singer":"SHE",
"size":13
}
//查询
GET /music/_doc/1
//修改
POST /music/_update/1/
{
"doc":{
"name":"说你爱我"
}
}
//删除
DELETE /music/_doc/1