• 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"
              ]
            }
          }
        ]
      }
    }
  • 相关阅读:
    【jstree】,实现双击父级节点展开/收缩子级节点(转)
    jqueryDropdownimage(神奇的下拉列表,能显示和选择图片的的下拉列表)
    简单的算法总结
    关于Jstree节点显示无法收缩的解决办法
    【blockUI】点击按钮,等待界面~
    HTML清除缓存
    vi快捷键(转载)
    python学习笔记(3)列表的常见方法
    shell学习笔记(1)Linux下在一行执行多条命令
    eclipse快捷键(转载)
  • 原文地址:https://www.cnblogs.com/a-du/p/11751176.html
Copyright © 2020-2023  润新知