日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

1、屬性說明和介紹

執行命令:

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

運行后的結果如下:

{"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:本次搜索,返回幾條結果
hits.max_score:本次搜索的所有結果中,最大的相關度分數是多少,每一條document對于search的相關度,越相關,_score分數越大,排位越靠前
hits.hits:默認查詢前10條數據,完整數據,_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查詢執行機制
timeout的單位可以是:毫秒,秒,分。
例:

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

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。