es、kibana学习

1、kibana控制台输出解释

{
  "took" : 1, 				--耗费了几毫秒
  "timed_out" : false,		--是否超时,false是没有,默认无timeout
  "_shards" : {				--执行请求时查询的分片信息
    "total" : 12,			--查询的分片数量
    "successful" : 12,		--成功返回结果的分片数量
    "skipped" : 0,			--跳过分片(es从 v5.6 开始引入了 pre-filter 机制(skipped):对于 Date 类型的 Range 查询,在对分片执行搜索之前,先检查一下分片是否包括被查询的数据范围,如果查询的范围与分片持有的数据没有交集,就跳过该分片。)
    "failed" : 0			--失败的分片数量
  },
  "hits" : {
    "total" : 10,			--查询返回的文档总数,默认查询前10条数据,按_score降序排序
    "max_score" : 1.0,		--计算所得的最高分,就是document对于一个search的相关度的匹配分数,越相关,就越匹配,分数也高
    "hits" : [				--返回文档的hits数组
      {
        "_index" : ".kibana_1",			--索引
        "_type" : "doc",				--类型
        "_id" : "space:default",		--标志符
        "_score" : 1.0,					--得分
        "_source" : {		--发送到索引的JSON对象
          "space" : {
            "name" : "Default",
            "description" : "This is your default space!",
            "color" : "#00bfb3",
            "_reserved" : true
          },
          "type" : "space",
          "updated_at" : "2021-07-06T04:55:35.788Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "doc",
        "_id" : "config:6.8.16",
        "_score" : 1.0,
        "_source" : {
          "config" : {
            "buildNum" : 20663
          },
          "type" : "config",
          "updated_at" : "2021-07-06T04:55:53.733Z"
        }
      },

      {
        "_index" : "taskinfo",
        "_type" : "taskReward",
        "_id" : "2",
        "_score" : 1.0,
        "_source" : {
          "name" : "two yagao",
          "desc" : "youxiao fangzhu",
          "price" : 25,
          "producer" : "jiajieshi producer",
          "tags" : [
            "fangzhu"
          ]
        }
      },
      {
        "_index" : "taskinfo",
        "_type" : "taskReward",
        "_id" : "1",
        "_score" : 1.0,
        "_source" : {
          "name" : "one yagao",
          "desc" : "gaoxiao meibai",
          "price" : 30,
          "producer" : "gaolujie producer",
          "tags" : [
            "meibai",
            "fangzhu"
          ]
        }
      },
      {
        "_index" : "taskinfo",
        "_type" : "taskReward",
        "_id" : "3",
        "_score" : 1.0,
        "_source" : {
          "name" : "three caoben yagao",
          "desc" : "caoben zhiwu",
          "price" : 40,
          "producer" : "zhonghua producer",
          "tags" : [
            "qingxin"
          ]
        }
      }
    ]
  }
}

2、es的基本概念

1、es重要概念
es重要概念:index索引, type类型, document文档, field字段

传统关系型数据库(eg: MySQL)与 Elasticsearch对比:

3、es的增删改查

posted @ 2025-04-29 16:15  harrylearn66666  阅读(10)  评论(0)    收藏  举报