zoukankan      html  css  js  c++  java
  • elasticsearch _search结果解析

    kibana中输入:GET /_search 会返回一下结果:

    {
      "took": 9, #  took:整个搜索请求花费多少毫秒
      "timed_out": false,
      "_shards": { # shards:shards fail的条件,primary和replica全部挂掉,不影响其他shard。
                   # 默认情况,一个搜索请求,会发送到一个index的所有primary shard上;
                   # 当然,一个primary shard可能会有多个replica shard,所以请求也可能到其中某个replica shard 上。
        "total": 20,
        "successful": 20,
        "skipped": 0,
        "failed": 0
      },
      "hits": {
        "total": 6, # 本次搜索,返回多少条结果
        "max_score": 1, # 本次搜索结果中最大的相关分数,
                        # 每一条document对于search的相关度,越相关,source分数越大,排位越靠前
        "hits": [ # 默认查询前十条数据,查询完整的数据,以_source降序排序
          {
            "_index": "ecommerce",
            "_type": "product",
            "_id": "2",
            "_score": 1,
            "_source": {
              "name": "jiajieshi yagao",
              "desc": "youxiao fangzhu",
              "price": 25,
              "producer": "jiajieshi producer",
              "tags": [
                "fangzhu"
              ]
            }
          },
          {
            "_index": "test_index",
            "_type": "test_type",
            "_id": "2",
            "_score": 1,
            "_source": {
              "test_field": "test client 1"
            }
          },
          {
            "_index": "ecommerce",
            "_type": "product",
            "_id": "1",
            "_score": 1,
            "_source": {
              "name": "gaolujie yagao",
              "desc": "gaoxiao meibai",
              "price": 30,
              "producer": "gaolujie producer",
              "tags": [
                "meibai",
                "fangzhu"
              ]
            }
          },
          {
            "_index": "my_index",
            "_type": "my_type",
            "_id": "1",
            "_score": 1,
            "_source": {
              "test_field": "test data 1"
            }
          },
          {
            "_index": "test_index",
            "_type": "test_type",
            "_id": "1",
            "_score": 1,
            "_source": {
              "test_field": "test client 1"
            }
          },
          {
            "_index": "ecommerce",
            "_type": "product",
            "_id": "3",
            "_score": 1,
            "_source": {
              "name": "zhonghua yagao",
              "desc": "caoben zhiwu",
              "price": 40,
              "producer": "zhonghua producer",
              "tags": [
                "qingxin"
              ]
            }
          }
        ]
      }
    }
  • 相关阅读:
    7.12-7.19 id、w、who、last、lastb、lastlog
    查询登录信息 w, who*, id, tty, last, finger
    [rhel-media] :Yum软件仓库唯一标识符,避免与其他仓库冲突。
    :整数 跳转到该行 Vim中常用的命令
    spec2006与spec2000的对比简要说明
    Linux性能监控与分析之--- CPU
    Android实现登录小demo
    python学习笔记——旧类与新类继承中的构造函数
    tair ldb存储引擎性能測试方案
    串口通讯方式1编程
  • 原文地址:https://www.cnblogs.com/a-du/p/11751176.html
Copyright © 2011-2022 走看看