Kibana基本操作ElasticSearch

2020-01-17  本文已影响0人  Echoooo_o

查询ES中所有数据

GET _search
{
"query": {
"match_all": {}
}
}

查询集群状况

GET _cat/health?v

查询节点信息

GET _cat/nodes?v

查询索引

GET _cat/indices

创建index 有两种方式 PUT POST

PUT 创建自定义属性 POST会自动创建规定的属性

PUT /test_index
{
"mappings": {
"_doc" : {
"properties" : {
"username" : {"type":"text"},
"password" : {"type":"long"}
}
}
}
}

查询映射关系

GET /test_index/_mapping/_doc/

插入数据

PUT /test_index/_doc/1
{
"username" : "logincat",
"password" : "123"
}

查询id=1的数据

GET /test_index/_doc/1

只显示数据

GET /test_index/_doc/1/_source

修改数据只能使用POST 而且需要使用_update 应该时之前的版本 6.5就可以用PUT

POST /test_index/_doc/1/_update
{
"doc": {
"password" : "12345"
}
}

上一篇下一篇

猜你喜欢

热点阅读