上一章講述了ELK的搭建,本章主要爲elasticsearch的基本使用elasticsearch
一、查看elasticsearch信息
ide
GET / spa
二、建立索引3d
PUT /testblog
三、獲取所有索引索引
GET _cat/indices?vip
四、向索引中插入數據ci
PUT /test/info/1it
{ast
"name":"zhangsan",
"age":20
}
五、獲取插入索引的信息
GET /test/info/1
六、獲取單條索引的所有信息
GET /test/_search?q=*
七、刪除索引中的數據
DELETE /test/info/1
八、更改某一類型的數據
九、批量更改數據
POST /test/_update_by_query
{
"script": {
"source" : "ctx._source['age']=26"
},
"query":{
"match_all": {}
}
}
、
查詢全部數據,age已經變動爲26
GET /test/_search?q=*
十、爲索引增長字段
POST /test/_update_by_query
{
"script": {
"source" : "ctx._source['city']='beijing'"
},
"query":{
"match_all": {}
}
}