美文网首页
Kibana基本操作ElasticSearch

Kibana基本操作ElasticSearch

作者: Echoooo_o | 来源:发表于2020-01-17 17:49 被阅读0次

    查询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"
    }
    }

    相关文章

      网友评论

          本文标题:Kibana基本操作ElasticSearch

          本文链接:https://www.haomeiwen.com/subject/yvqhzctx.html