日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

ES中搜索结果各属性说明介绍,以及搜索中的timeout机制讲解(来自学习资料,34节)

發(fā)布時間:2024/9/27 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ES中搜索结果各属性说明介绍,以及搜索中的timeout机制讲解(来自学习资料,34节) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1、屬性說明和介紹

執(zhí)行命令:

GET /test_index/test_type/_search?timeout=1s

運行后的結(jié)果如下:

{"took": 4,"timed_out": false,"_shards": {"total": 3,"successful": 3,"failed": 0},"hits": {"total": 11,"max_score": 1,"hits": [{"_index": "test_index","_type": "test_type","_id": "5","_score": 1,"_source": {"test_field": "test3"}},{"_index": "test_index","_type": "test_type","_id": "6","_score": 1,"_source": {"test_field": "test6"}},{"_index": "test_index","_type": "test_type","_id": "7","_score": 1,"_source": {"test_field": "test7"}},{"_index": "test_index","_type": "test_type","_id": "2","_score": 1,"_source": {"test_field": "test2"}},{"_index": "test_index","_type": "test_type","_id": "4","_score": 1,"_source": {"test_field": "test4"}},{"_index": "test_index","_type": "test_type","_id": "AWPE334kH290KcMbohDu","_score": 1,"_source": {"test_content": "my test2"}},{"_index": "test_index","_type": "test_type","_id": "AWPE4LcyH290KcMbohDx","_score": 1,"_source": {"test_content": "my test2"}},{"_index": "test_index","_type": "test_type","_id": "AWPE4ARFH290KcMbohDv","_score": 1,"_source": {"test_content": "my test2"}},{"_index": "test_index","_type": "test_type","_id": "AWPE4JVHH290KcMbohDw","_score": 1,"_source": {"test_content": "my test2"}},{"_index": "test_index","_type": "test_type","_id": "3","_score": 1,"_source": {"test_field": "test3"}}]} }

屬性介紹:
took:整個搜索花費了多少毫秒

hits.total:本次搜索,返回幾條結(jié)果
hits.max_score:本次搜索的所有結(jié)果中,最大的相關(guān)度分數(shù)是多少,每一條document對于search的相關(guān)度,越相關(guān),_score分數(shù)越大,排位越靠前
hits.hits:默認查詢前10條數(shù)據(jù),完整數(shù)據(jù),_score降序排序。
**shards:**shards fail的條件(primary和replica全部掛掉),不影響其他shard。默認情況下來說,一個搜索請求,會打到一個index的所有primary shard上去,當然了,每個primary shard都可能會有一個或多個replic shard,所以請求也可以到primary shard的其中一個replica shard上去。

2、timeout圖解介紹

timeout:默認無timeout,,latency平衡completeness,手動指定timeout,timeout查詢執(zhí)行機制
timeout的單位可以是:毫秒,秒,分。
例:

timeout=10ms,timeout=1s,timeout=1mGET /test_index/test_type/_search?timeout=1ms

總結(jié)

以上是生活随笔為你收集整理的ES中搜索结果各属性说明介绍,以及搜索中的timeout机制讲解(来自学习资料,34节)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。