上一章讲述了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": {}
}
}