Elasticsearch系统学习(十一)-mapping

时间:2019-09-03
本文章向大家介绍Elasticsearch系统学习(十一)-mapping,主要包括Elasticsearch系统学习(十一)-mapping使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1、搜索结果各项含义

GET /_search

{
  "took": 6,   #整个搜索请求花费了多少毫秒
  "timed_out": false,  #是否超时,可以手动指定超时时间
  "_shards": {    #默认一个搜索请求,会打到index的所有primary shard上去,每个primary shard都可能会有一个或多个replic shard,所以请求也可以到primary shard的其中一个replica shard上去。
    "total": 6,
    "successful": 6,  #shards fail的条件(primary和replica全部挂掉)
    "failed": 0
  },
  "hits": {
    "total": 10,   #本次搜索,返回了几条结果
    "max_score": 1,   #本次搜索的所有结果中,最大的相关度分数是多少,每一条document对于search的相关度,越相关,_score分数越大,排位越靠前
    "hits": [   #默认查询前10条数据,完整数据,_score降序排序
      {
        "_index": ".kibana",
        "_type": "config",
        "_id": "5.2.0",
        "_score": 1,
        "_source": {
          "buildNum": 14695
        }
      }
    ]
  }
}

原文地址:https://www.cnblogs.com/hujinzhong/p/11452273.html