{"id":221053,"date":"2020-11-22T16:41:09","date_gmt":"2020-11-22T08:41:09","guid":{"rendered":"http:\/\/4563.org\/?p=221053"},"modified":"2020-11-22T16:41:09","modified_gmt":"2020-11-22T08:41:09","slug":"%e4%b8%80%e4%b8%aa%e5%85%b3%e4%ba%8e-es-%e7%9a%84%e9%97%ae%e9%a2%98%e5%92%8c_stats-%e8%bf%99%e4%b8%aa%e6%8e%a5%e5%8f%a3%e6%9c%89%e5%85%b3","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=221053","title":{"rendered":"\u4e00\u4e2a\u5173\u4e8e ES \u7684\u95ee\u9898,\u548c_stats \u8fd9\u4e2a\u63a5\u53e3\u6709\u5173"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e00\u4e2a\u5173\u4e8e ES \u7684\u95ee\u9898,\u548c_stats \u8fd9\u4e2a\u63a5\u53e3\u6709\u5173               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nekoneko <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6709\u4e00\u4e2a\u9700\u6c42\u662f\u8fd4\u56de\u5f53\u524d\u6240\u6709 index \u53ca\u5176\u5bf9\u5e94\u7684\u6587\u6863\u6570\u91cf,<br \/> \u53d1\u73b0 <code>_stats<\/code> \u63a5\u53e3\u53ef\u4ee5\u53ef\u4ee5\u505a\u5230<br \/> \u4f46\u662f\u76ee\u524d\u6ca1\u627e\u5230\u5728 <code>RestHighLevelClient<\/code> \u4e2d\u5bf9\u5e94\u7684\u64cd\u4f5c<\/p>\n<ul>\n<li>\u65e2\u7136\u6211\u5df2\u8bda\u5fc3\u8bda\u610f\u5f97\u53d1\u95ee\u4e86<\/li>\n<li>\u6709\u6ca1\u6709\u8c01\u5927\u53d1\u6148\u60b2\u544a\u8bc9\u6211<\/li>\n<li>\u4e3a\u4e86\u9632\u6b62\u4e16\u754c\u88ab\u7834\u574f<\/li>\n<li>\u4e3a\u4e86\u5b88\u62a4\u4e16\u754c\u7684\u548c\u5e73<\/li>\n<\/ul>\n<p><code>_stats<\/code>\u5728<code>HighLevelClient<\/code>\u91cc\u9762\u6709\u6ca1\u6709\u5bf9\u5e94\u64cd\u4f5c<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4451838\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rrfeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u5c5e\u4e8e\u7ba1\u7406\u63a5\u53e3\uff0c\u627e\u627e\u770b\u6709\u6ca1\u6709 admin client \u4e4b\u7c7b\u7684\u73a9\u610f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451839\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chendy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u53ea\u662f\u8981\u83b7\u53d6\u6587\u6863\u6570\u91cf\u7684\u8bdd<br \/>\u53d1\u4e00\u4e2a\u6ca1\u6709\u6761\u4ef6\uff0csize=0 \u7684 search\uff0c\u53d6 hits\uff0c\u6ee1\u8db3\u9700\u6c42\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451840\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : z657386160z <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/client\/java-rest\/current\/java-rest-high-enrich-enrich-stats.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451841\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fantastM <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u6765\u8001\u54e5\u4e5f\u662f\u4e2a\u5b9d\u53ef\u68a6\u7c89                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451842\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nekoneko <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @z657386160z #3 \u8fd9\u4e2a\u8bd5\u4e86,\u4e0d\u662f\u8fd9\u4e2a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451843\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nekoneko <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @chendy #2 \u73b0\u5728\u662f\u8fd9\u6837\u53d6\u7684,\u4f46\u662f\u6211\u6709 500 \u4e2a index \u7684\u8bdd\u5c31\u5f97\u5faa\u73af 500 \u6b21\u8bf7\u6c42&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451844\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chendy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nekoneko #6 index \u540d\u5b57\u4f20\u4e2a * \u5c31\u662f\u6240\u6709 index \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451845\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nekoneko <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @chendy #7 \u8fa3\u4e2a\u67e5\u51fa\u6765\u662f\u6240\u6709 index \u52a0\u8d77\u6765\u7684,\u6211\u60f3\u67e5\u6bcf\u4e2a\u7d22\u5f15\u5bf9\u5e94\u7684\u6587\u6863\u6570\u91cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451846\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nekoneko <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @rrfeng #1 <br \/>@chendy #2 <br \/>@z657386160z #3 <\/p>\n<p>highLevel \u91cc\u9762\u6ca1\u6709,\u76f4\u63a5\u7528 lowlevel \u53bb\u62ff\u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451847\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : nekoneko <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;`<br \/> RestClient lowLevelClient = client.getLowLevelClient();<br \/> Request request = new Request(&#8220;GET&#8221;, &#8220;\/_stats&#8221;);<br \/> Response response = lowLevelClient.performRequest(request);<br \/> HttpEntity entity = response.getEntity();<br \/> InputStream content = entity.getContent();<br \/> HashMap responseMap = objectMapper.readValue(content, HashMap.class);<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451848\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RudyS <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             curl -XGET &#8216;localhsot:9200\/_cat\/indices?v&#8217; | awk &#8216;{print $3&#8243; ==&gt; &#8220;$7}&#8217;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u5173\u4e8e ES \u7684\u95ee\u9898,\u548c_sta&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/221053"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=221053"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/221053\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221053"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}