# 查询所有索引
GET /_cat/indices?v
# 创建名为customer的索引
PUT /customer?pretty
# 给customer的索引插入id为1, name为test的值
PUT /customer/_doc/2?pretty
{
"name" : "2test2"
}
# 更新索引表
POST /customer/_doc/1/_update?pretty
{
"doc" : {"name":"test1", "sex": "f"}
}
#获取索引为customer,id为1的数据
GET /customer/_doc/1?pretty
#删除索引为customer中id为2的数据
DELETE /customer/_doc/2?pretty
# 查询customer索引中数据
GET /customer/_search?pretty
# 查询5条customer索引中数据
GET /linux_host/_search
{
"query":{
"match_all":{}
},
"size": 5
}
#查询表linux_host,完全匹配
GET /linux_host/_search
{
"query":{
"bool": {
"must": [
{ "match": { "host_ip": "192.168.17.31" } },
{ "match": { "collect_time": "1558429709686" } }
]
}
}
}