ES(八)在kibana 测试篇

未完结:

1.添加测试数据:

PUT /myindex/article/1
{
  "post_date":"2020-12-08",
  "title":"java",
  "author_id":"119"
}

按id 查询:

GET /myindex/article/1

结果:

{
  "_index" : "myindex",
  "_type" : "article",
  "_id" : "1",
  "_version" : 1,
  "_seq_no" : 0,
  "_primary_term" : 1,
  "found" : true,
  "_source" : {
    "post_date" : "2020-12-08",
    "title" : "java",
    "author_id" : "119"
  }
}

2.按条件查询:

GET /myindex/article/1?_source=title

结果:

{
  "_index" : "myindex",
  "_type" : "article",
  "_id" : "1",
  "_version" : 1,
  "_seq_no" : 0,
  "_primary_term" : 1,
  "found" : true,
  "_source" : {
    "title" : "java"
  }
}

3.查询所有索引:

GET _all/_settings

结果:

{
  ".kibana_task_manager" : {
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "auto_expand_replicas" : "0-1",
        "provided_name" : ".kibana_task_manager",
        "creation_date" : "1607401049582",
        "number_of_replicas" : "0",
        "uuid" : "viHsmmMMSEumCMZEP9i_ww",
        "version" : {
          "created" : "6080099"
        }
      }
    }
  },
  ".kibana_1" : {
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "auto_expand_replicas" : "0-1",
        "provided_name" : ".kibana_1",
        "creation_date" : "1607401050268",
        "number_of_replicas" : "0",
        "uuid" : "2k6DXFIqSUCMVAAjFLh-Pg",
        "version" : {
          "created" : "6080099"
        }
      }
    }
  },
  "myindex" : {
    "settings" : {
      "index" : {
        "creation_date" : "1607418158668",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "caSbPZoMQhukzdWyVDCL7A",
        "version" : {
          "created" : "6080099"
        },
        "provided_name" : "myindex"
      }
    }
  }
}

 

GET /myindex/article/_mget
{
  "ids":[1,2]
}

结果:

{
  "docs" : [
    {
      "_index" : "myindex",
      "_type" : "article",
      "_id" : "1",
      "_version" : 1,
      "_seq_no" : 0,
      "_primary_term" : 1,
      "found" : true,
      "_source" : {
        "post_date" : "2020-12-08",
        "title" : "java",
        "author_id" : "119"
      }
    },
    {
      "_index" : "myindex",
      "_type" : "article",
      "_id" : "2",
      "_version" : 1,
      "_seq_no" : 0,
      "_primary_term" : 1,
      "found" : true,
      "_source" : {
        "post_date" : "2020-11-08",
        "title" : "ES",
        "author_id" : "120"
      }
    }
  ]
}

测试语句:

GET _search
{
  "query": {
    "match_all": {}
  }
}
PUT /myindex/article/1
{
  "post_date":"2020-12-08",
  "title":"java",
  "author_id":"119"
}
PUT /myindex/article/2
{
  "post_date":"2020-11-08",
  "title":"ES",
  "author_id":"120"
}
GET _all/_settings
GET /myindex/_settings
GET /myindex/article/_settings
GET /myindex/article/1
GET /myindex/article/2

GET /myindex/article/1?_source=title
GET /myindex/article/_mapping

DELETE /myindex

GET /myindex/article/_mget
{
  "ids":[1,2]
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我先来一碗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值