{"id":94549,"date":"2020-05-08T12:35:30","date_gmt":"2020-05-08T04:35:30","guid":{"rendered":"http:\/\/4563.org\/?p=94549"},"modified":"2020-05-08T12:35:30","modified_gmt":"2020-05-08T04:35:30","slug":"es-%e6%9f%a5%e8%af%a2%e6%9d%a1%e4%bb%b6%e4%b8%8d%e7%94%9f%e6%95%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=94549","title":{"rendered":"es \u67e5\u8be2\u6761\u4ef6\u4e0d\u751f\u6548"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  es \u67e5\u8be2\u6761\u4ef6\u4e0d\u751f\u6548               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chenguoyu <\/span>  <span><i><\/i> 26<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>{     \"from\": 3890,     \"size\": 10,     \"query\": {         \"bool\": {             \"must\": [                 {                     \"range\": {                         \"receive_log_time\": {                             \"from\": 1587225600000,                             \"to\": 1587288897000,                             \"include_lower\": true,                             \"include_upper\": true                         }                     }                 },                 {                     \"bool\": {                         \"must\": {                             \"term\": {                                 \"rule_level\": \"4\"                             }                         }                     }                 }             ],             \"should\": {                 \"bool\": {                     \"must\": {                         \"term\": {                             \"rule_level\": \"5\"                         }                     }                 }             }         }     } } <\/code><\/pre>\n<p>\u5176\u4e2d should \u4e0b\u9762\u7684\u6761\u4ef6\u6ca1\u6709\u751f\u6548\uff0c\u8bf7\u95ee\u6709\u4eba\u77e5\u9053\u539f\u56e0\u5417\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>12<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1216926\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aureole999 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             should \u548c must \u5e76\u5217\u7684\u8bdd should \u5c31\u53ef\u4ee5\u4e0d\u5339\u914d\u4e86\u3002must \u90a3\u8fb9 rule_level \u5df2\u7ecf\u5fc5\u987b\u662f 4 \u4e86\uff0cshould \u90a3\u8fb9\u5c31\u6ca1\u6709\u4e86\u3002<br \/>\u9664\u975e\u4f60\u7684 rule_level \u662f\u4e2a\u5217\u8868\uff0c\u90a3 rule_level \u540c\u65f6\u5305\u542b 4\uff0c5 \u7684\u4f1a\u5728\u6700\u524d\u9762\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216927\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : misaka19000 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             should \u6211\u8bb0\u5f97\u6709\u4e2a minimum_match \u5c5e\u6027                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216928\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : misaka19000 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/query-dsl-minimum-should-match.html<\/p>\n<p>\u5982\u679c\u6ca1\u6709 must\uff0c\u9ed8\u8ba4\u503c\u4e3a 1 \uff1b\u5982\u679c\u6709 must\uff0c\u9ed8\u8ba4\u503c\u4e3a 0<\/p>\n<p>\u5982\u679c\u6211\u6ca1\u8bb0\u9519\u7684\u8bdd : )                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216929\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : woniu127 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/www.cnblogs.com\/chenmz1995\/p\/11446422.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216930\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rqrq <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u5c31\u7b49\u540c\u4e8e sql \u7684 or \u6761\u4ef6\uff0c\u4e0d\u786e\u5b9a\u5c31\u5199\u6210 sql \u8bed\u53e5\u7136\u540e\u7528 \/_sql\/translate \u63a5\u53e3\u8f6c dsl                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216931\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : j747677392 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             should \u76f8\u5f53\u4e8e or\uff0cmust \u76f8\u5f53\u4e8e and \u4e24\u4e2a\u540c\u7ea7 should \u5c31\u6ca1\u6548\u679c\u4e86\u3002\u4e0d\u77e5\u9053\u4f60\u8981\u5b9e\u73b0\u4ec0\u4e48\uff0c\u4e00\u822c\u6700\u5916\u5c42\u53ea\u7528 should \u6216 must \u6216 mustnot \u5176\u4e2d\u4e00\u4e2a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216932\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : enrio <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u77e5\u9053\u81ea\u5df1\u60f3\u67e5\u4ec0\u4e48\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216933\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : chenguoyu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @enrio #7 \u6211\u60f3\u8981\u7684\u6548\u679c\u662f\u7c7b\u4f3c\u4e8e sql \u4e2d <br \/>where <br \/>(\u6761\u4ef6 1 and \u6761\u4ef6 2)<br \/>or<br \/>(\u6761\u4ef6 3 and \u6761\u4ef6 4)<br \/>and<br \/>(\u6761\u4ef6 5 or \u6761\u4ef6 6)<br \/>\u8fd9\u6837\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216934\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : enrio <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @chenguoyu <br \/>bool:{<br \/> should:[<br \/> {<br \/> bool:{<br \/> must:[\u6761\u4ef6 1\uff0c\u6761\u4ef6 2]<br \/> }<br \/> },<br \/> {<br \/> bool:{<br \/> must:[<br \/> {<br \/> bool:{<br \/> must:[\u6761\u4ef6 3\uff0c\u6761\u4ef6 4]<br \/> }<br \/> },<br \/> {<br \/> bool:{<br \/> should:[\u6761\u4ef6 5\uff0c\u6761\u4ef6 6],<br \/> mininum_should_match:1<br \/> }<br \/> }<br \/> ]<br \/> }<br \/> }<br \/> ],<br \/> mininum_should_match:1<br \/>}                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216935\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : enrio <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @chenguoyu \u8fd9\u6392\u7248\u6709\u591f\u6076\u5fc3<br \/>\u770b\u8fd9\u4e2a\u56fe\u7247\uff0chttps:\/\/pic.downk.cc\/item\/5e9d03c1c2a9a83be50e60b8.png \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216936\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Flourite <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 terms                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1216937\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yang2yang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             9 \u8bf4\u7684\u5bf9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>es \u67e5\u8be2\u6761\u4ef6\u4e0d\u751f\u6548 \u8cc7\u6df1\u5927\u4f6c :&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\/94549"}],"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=94549"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/94549\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94549"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}