kibana简单操作ElasticSearch
kibana常用命令
#查看某index数据
GET index_name/_search
{
"query": {
"match_all": {}
},
"sort::[{"name",:"desc、asc"}]
}
#分页查看某index数据,get方法默认10条数据
POST index_name/_search
{
"size": 2, --记录条数
"from": 10, --页数
"query": {
"match_all": {}
}
}
#清空某index数据
GET index_name/_delete_by_query
{
"query": {
"match_all": {}
}
}
#按照某一字段根据范围筛选数据
GET index_name/_search
{
"query": {
"range":{
"createTime":{
"gte":"2020-03-14 00:00:00",
"lte":"2020-03-19 00:00:00"
}
}
}
}
#按照某一字段查询数据
GET path-record/_search
{
"query": {
"match": {"passId":"009600129A15144A20200209122359" }
}
}
#创建index
PUT index_name
#删除index
DELETE index_name
#插入数据
PUT /index_name/type_name/id
{
"title": "中国",
"content": "中国银行"
}
#检索文档
GET index_name/type_name/id
#替换文档(全量替换)
PUT /index_name/type_name/id
{
"name" : "jiaqiangban gaolujie yagao",
"desc" : "gaoxiao meibai",
"price" : 30,
"producer" : "gaolujie producer",
"tags": [ "meibai", "fangzhu" ]
}
#更新文档(修改)
POST /index_name/type_name/id_update
{
"doc": {
"name": "jiaqiangban gaolujie yagao"
}
}
删除文档
DELETE /index_name/type_name/id
相关文章