ES中search返回参数讲解
2020-04-19 本文已影响0人
还是那个没头脑
took:表示整个搜索请求花费了多少毫秒
hits.total:本次搜索,返回了几条结果
hits.max_score:本次搜索的所有结果中,最大的相关度分数是多少。每一条document对于search的相关度,越相关,_score分数越大,排位越靠前
hits.hits:默认查询出前10条数据,完整数据,_score降序排序
shards:shard fail的条件,不影响其他shard。默认情况下来说,一个搜索请求,会打到一个index的所有primary shard上去,当然了,每个primary shard都可能会有一个或多个replic shard,所以请求也可以到primary shard的其中一个replica shard上去。
timeout:默认无timeout,latency平衡completeness,手动指定timeout,timeout查询执行机制
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 2342,
"max_score": 24.293804,
"hits": [
{
"_index": "h_cv",
"_type": "cv",
"_id": "181",
"_score": 24.293804,
"_source": {
"p_id": "0146000008",
"s_date": "2017-04-01",
"e_date": "2019-09-17",
"c_loc": "海南",
"c_unit": "海南省委政法委员会",
"c_dep": null,
"c_ide": "副秘书长"
}
},
{
"_index": "h_cv",
"_type": "cv",
"_id": "261",
"_score": 24.293804,
"_source": {
"p_id": "0146000014",
"s_date": "2016-09-01",
"e_date": "2019-09-17",
"c_loc": "海南",
"c_unit": "海南省委政法委员会",
"c_dep": null,
"c_ide": "委员"
}
}
]
}
}