{"id":50912,"date":"2025-08-10T14:34:16","date_gmt":"2025-08-10T06:34:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50912.html"},"modified":"2025-08-10T14:34:16","modified_gmt":"2025-08-10T06:34:16","slug":"%e7%94%a8-esql-%e5%81%9a%e6%90%9c%e7%b4%a2%e4%bb%8e%e8%bf%87%e6%bb%a4%e5%88%b0%e7%9b%b8%e5%85%b3%e6%80%a7%e3%80%81%e5%86%8d%e5%88%b0%e8%af%ad%e4%b9%89%e4%b8%8e%e6%b7%b7%e5%90%88%e6%a3%80%e7%b4%a2","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50912.html","title":{"rendered":"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22"},"content":{"rendered":"<h3>\u4e00\u3001\u8fc7\u6ee4 vs. \u641c\u7d22<\/h3>\n<ul>\n<li>\u8fc7\u6ee4&#xff08;filtering&#xff09;&#xff1a;\u53ea\u51b3\u5b9a\u201c\u662f\u5426\u5339\u914d\u201d&#xff0c;\u4e0d\u7b97\u5206&#xff0c;\u901f\u5ea6\u5feb&#xff0c;\u9002\u5408\u7cbe\u786e\u6761\u4ef6\/\u8303\u56f4\/\u5e03\u5c14\u903b\u8f91\u3002<\/li>\n<li>\u641c\u7d22&#xff08;searching&#xff09;&#xff1a;\u5148\u8fc7\u6ee4&#xff0c;\u518d\u6309\u76f8\u5173\u6027\u7ed9\u7ed3\u679c\u6253\u5206\u4e0e\u6392\u5e8f&#xff1b;\u4f1a\u7528\u5230\u5206\u8bcd\u3001\u540c\u4e49\u8bcd\u3001\u6a21\u7cca\u7b49\u6587\u672c\u5206\u6790\u3002 \u5728 ES|QL \u4e2d&#xff0c;\u662f\u5426\u201c\u6309\u76f8\u5173\u6027\u6392\u5e8f\u201d\u7531\u4f60\u663e\u5f0f\u51b3\u5b9a&#xff1a;\u52a0 METADATA _score \u5f00\u542f\u8bc4\u5206&#xff0c;\u5e76\u7528 SORT _score DESC \u624d\u4f1a\u770b\u5230\u201c\u6700\u76f8\u5173\u5728\u524d\u201d\u3002\u5426\u5219\u5373\u4fbf\u7528\u4e86 MATCH \u8fd9\u7c7b\u51fd\u6570&#xff0c;\u4e5f\u53ea\u662f\u8fc7\u6ee4\u4e0d\u6392\u5e8f\u3002(Elastic)<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u7248\u672c\u65f6\u95f4\u7ebf&#xff08;\u901f\u67e5&#xff09;<\/h3>\n<table>\n<tr>\u80fd\u529b\u8bf4\u660e\u9996\u6b21\u63d0\u4f9b<\/tr>\n<tbody>\n<tr>\n<td>MATCH \/ :<\/td>\n<td>\u57fa\u7840\u5168\u6587\u5339\u914d&#xff08;\u51fd\u6570\u4e0e\u5192\u53f7\u8fd0\u7b97\u7b26\u4e24\u79cd\u5199\u6cd5&#xff09;<\/td>\n<td>8.17 (Elastic)<\/td>\n<\/tr>\n<tr>\n<td>QSTR()<\/td>\n<td>Query String \u8bed\u6cd5\u7684\u51fd\u6570\u7248<\/td>\n<td>8.17 (Elastic)<\/td>\n<\/tr>\n<tr>\n<td>\u76f8\u5173\u6027\u8bc4\u5206<\/td>\n<td>METADATA _score &#043; SORT _score<\/td>\n<td>8.18\/9.0 (Elastic)<\/td>\n<\/tr>\n<tr>\n<td>\u8bed\u4e49\u68c0\u7d22<\/td>\n<td>\u5728 semantic_text \u5b57\u6bb5\u4e0a\u4f7f\u7528\u641c\u7d22\u51fd\u6570<\/td>\n<td>8.18\/9.0 (Elastic)<\/td>\n<\/tr>\n<tr>\n<td>\u6df7\u5408\u68c0\u7d22<\/td>\n<td>\u8bcd\u6cd5 &#043; \u8bed\u4e49&#xff0c;\u81ea\u5b9a\u4e49\u6743\u91cd<\/td>\n<td>8.18\/9.0 (Elastic)<\/td>\n<\/tr>\n<tr>\n<td>KQL()<\/td>\n<td>\u5728 ES|QL \u91cc\u590d\u7528 Kibana Query Language<\/td>\n<td>8.18\/9.0 (Elastic)<\/td>\n<\/tr>\n<tr>\n<td>MATCH_PHRASE()<\/td>\n<td>\u7b49\u4ef7 DSL \u7684 match_phrase<\/td>\n<td>8.19\/9.1 (Elastic)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53c2\u8003&#xff1a;Elastic \u5b98\u65b9\u201cES|QL for search\u201d\u4e0e\u53d1\u5e03\/\u5b9e\u9a8c\u5ba4\u6587\u7ae0\u3002(Elastic)<\/p>\n<h3>\u4e09\u3001\u5199\u6cd5\u901f\u901a&#xff1a;\u6700\u5e38\u7528 6 \u79cd<\/h3>\n<p>\u7ea6\u5b9a&#xff1a;FROM index \u5f00\u5934&#xff0c;WHERE \u91cc\u653e\u6761\u4ef6&#xff0c;LIMIT \u63a7\u5236\u6761\u6570\u3002<\/p>\n<h4>A. \u57fa\u7840\u5168\u6587\u5339\u914d&#xff08;MATCH \/ :&#xff09;<\/h4>\n<p><span class=\"token keyword\">FROM<\/span> my_index METADATA _score<br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">WHERE<\/span> <span class=\"token keyword\">MATCH<\/span><span class=\"token punctuation\">(<\/span>content<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;quick brown fox&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token operator\">|<\/span> SORT _score <span class=\"token keyword\">DESC<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">10<\/span><br \/>\n<span class=\"token comment\">&#8212; \u7b49\u4ef7\u7b80\u5199&#xff1a;<\/span><br \/>\n<span class=\"token comment\">&#8212; FROM my_index METADATA _score | WHERE content : &#034;quick brown fox&#034; | SORT _score DESC | LIMIT 10<\/span><\/p>\n<p>\u8bc4\u5206\u4e0e\u6392\u5e8f\u9760 _score \u542f\u7528\u4e0e\u964d\u5e8f\u6392\u5e8f\u3002(Elastic)<\/p>\n<h4>B. \u77ed\u8bed\u5339\u914d&#xff08;MATCH_PHRASE&#xff09;<\/h4>\n<p><span class=\"token keyword\">FROM<\/span> articles METADATA _score<br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">WHERE<\/span> MATCH_PHRASE<span class=\"token punctuation\">(<\/span>title<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;open source license&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token operator\">|<\/span> SORT _score <span class=\"token keyword\">DESC<\/span><\/p>\n<p>\u7b49\u4ef7\u4e8e DSL \u7684 match_phrase\u3002(Elastic)<\/p>\n<h4>C. Query String&#xff08;QSTR()&#xff09;<\/h4>\n<p><span class=\"token keyword\">FROM<\/span> docs METADATA _score<br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">WHERE<\/span> QSTR<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;title:(golang OR &#034;go lang&#034;) AND -status:archived&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token operator\">|<\/span> SORT _score <span class=\"token keyword\">DESC<\/span><\/p>\n<p>\u4fdd\u7559 DSL query_string \u7684\u590d\u6742\u8868\u8fbe\u529b&#xff08;\u901a\u914d\u3001\u5e03\u5c14\u3001\u591a\u5b57\u6bb5&#xff09;\u3002(Elastic)<\/p>\n<h4>D. KQL&#xff08;KQL()&#xff09;<\/h4>\n<p><span class=\"token keyword\">FROM<\/span> logs METADATA _score<br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">WHERE<\/span> KQL<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;status.code &gt;&#061; 500 and service.name : &#034;api*&#034;&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token operator\">|<\/span> SORT _score <span class=\"token keyword\">DESC<\/span><\/p>\n<p>\u4fbf\u4e8e\u4ece Kibana \u8fc1\u79fb\u67e5\u8be2\u5230 ES|QL\u3002(Elastic)<\/p>\n<h4>E. \u8bed\u4e49\u68c0\u7d22&#xff08;semantic_text&#xff09;<\/h4>\n<p><span class=\"token keyword\">FROM<\/span> knowledge_base METADATA _score<br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">WHERE<\/span> <span class=\"token keyword\">MATCH<\/span><span class=\"token punctuation\">(<\/span>semantic_body<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;how to reset a lost password?&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token operator\">|<\/span> SORT _score <span class=\"token keyword\">DESC<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">5<\/span><\/p>\n<p>\u628a\u5b57\u6bb5\u6620\u5c04\u4e3a semantic_text \u540e&#xff0c;\u5373\u53ef\u7528\u4e0e\u5168\u6587\u4e00\u81f4\u7684\u5199\u6cd5\u6267\u884c\u8bed\u4e49\u68c0\u7d22&#xff1b;\u5d4c\u5165\u751f\u6210\u4e0e\u5207\u5206\u7531\u540e\u7aef\u6258\u7ba1\u3002(Elastic)<\/p>\n<h4>F. \u6df7\u5408\u68c0\u7d22&#xff08;\u8bed\u4e49 &#043; \u8bcd\u6cd5&#xff0c;\u6743\u91cd\u53ef\u914d&#xff09;<\/h4>\n<p><span class=\"token keyword\">FROM<\/span> cooking_blog METADATA _score<br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">WHERE<\/span> <span class=\"token keyword\">MATCH<\/span><span class=\"token punctuation\">(<\/span>semantic_description<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;easy vegetarian meals&#034;<\/span><span class=\"token punctuation\">,<\/span> { <span class=\"token string\">&#034;boost&#034;<\/span>: <span class=\"token number\">0.75<\/span> }<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token operator\">OR<\/span> <span class=\"token keyword\">MATCH<\/span><span class=\"token punctuation\">(<\/span>tags<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;vegetarian&#034;<\/span><span class=\"token punctuation\">,<\/span> { <span class=\"token string\">&#034;boost&#034;<\/span>: <span class=\"token number\">0.25<\/span> }<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token operator\">|<\/span> SORT _score <span class=\"token keyword\">DESC<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">5<\/span><\/p>\n<p>\u5b9e\u6218\u91cc\u53ef\u505a\u7ebf\u6027\u52a0\u6743\u6216 RRF \u7b49\u878d\u5408\u7b56\u7565&#xff0c;\u8fd9\u91cc\u5c55\u793a\u7ebf\u6027\u6743\u91cd\u3002(Elastic)<\/p>\n<h3>\u56db\u3001\u4f55\u65f6\u9009\u201c\u8fc7\u6ee4\u201d&#xff0c;\u4f55\u65f6\u9009\u201c\u641c\u7d22\u201d&#xff1f;<\/h3>\n<p>\u9009\u8fc7\u6ee4&#xff08;\u5feb&#xff09;&#xff1a;\u7cbe\u786e\u7c7b\u76ee&#xff08;category.keyword&#061;&#034;Electronics&#034;&#xff09;\u3001\u65f6\u95f4\/\u6570\u503c\u8303\u56f4\u3001\u5e03\u5c14\u7ec4\u5408\u3001\u4f60\u53ea\u5173\u5fc3\u201c\u5168\u5339\u914d\u96c6\u5408\u201d\u3002 \u9009\u641c\u7d22&#xff08;\u51c6&#xff09;&#xff1a;\u81ea\u7136\u8bed\u8a00\u67e5\u8be2\u3001\u9700\u8981\u201c\u6700\u4f73\u547d\u4e2d\u5728\u524d\u201d\u3001\u9700\u8981\u5206\u8bcd\/\u540c\u4e49\u8bcd\/\u6a21\u7cca\u3002 \u5728 ES|QL \u91cc&#xff0c;\u540c\u4e00\u6761\u8bed\u53e5\u53ef\u4ee5\u5148 WHERE \u505a\u8fc7\u6ee4&#xff0c;\u518d MATCH \u641c\u7d22\u5e76\u6309 _score \u6392\u5e8f&#xff0c;\u505a\u5230\u201c\u5148\u7c97\u540e\u7cbe\u201d\u3002(Elastic)<\/p>\n<h3>\u4e94\u3001\u4e0e Query DSL \u7684\u5173\u7cfb\u4e0e\u8fc1\u79fb\u5efa\u8bae<\/h3>\n<ul>\n<li>\u591a\u6570 DSL \u641c\u7d22\u80fd\u529b\u5728 ES|QL \u91cc\u90fd\u6709\u201c\u51fd\u6570\u7b49\u4ef7\u7269\u201d&#xff1a;match\u2192MATCH()\/:\u3001match_phrase\u2192MATCH_PHRASE()\u3001query_string\u2192QSTR()\u3001Kibana \u67e5\u8be2\u2192KQL()\u3002(Elastic)<\/li>\n<li>\u8fc1\u79fb\u65f6\u5148\u7b49\u4ef7\u66ff\u6362&#xff0c;\u518d\u663e\u5f0f\u52a0\u4e0a METADATA _score | SORT _score DESC \u624d\u80fd\u5f97\u5230\u76f8\u5173\u6027\u6392\u5e8f\u3002(Elastic)<\/li>\n<li>\u9700\u8981\u7eaf DSL \u7684\u8bed\u4e49\u67e5\u8be2&#xff08;semantic query&#xff09;\u4e5f\u53ef\u7528\u5728 DSL&#xff1b;\u800c\u5728 ES|QL \u91cc&#xff0c;\u5efa\u8bae\u76f4\u63a5\u7528 semantic_text &#043; MATCH\/\u6df7\u5408\u68c0\u7d22\u3002(Elastic)<\/li>\n<\/ul>\n<h3>\u516d\u3001\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22\u7684\u5de5\u7a0b\u8981\u70b9<\/h3>\n<ul>\n<li>semantic_text \u6620\u5c04&#xff1a;\u81ea\u52a8\u505a\u5d4c\u5165\u751f\u6210\u4e0e\u957f\u6587\u672c\u5207\u5206&#xff0c;\u663e\u8457\u7b80\u5316\u7ba1\u7ebf&#xff08;\u65e0\u9700\u624b\u5199\u63a8\u7406 pipeline&#xff09;\u3002(Elastic)<\/li>\n<li>\u6df7\u5408\u7b56\u7565&#xff1a;\u7ebf\u6027\u52a0\u6743&#xff08;\u5982\u4e0a\u793a\u4f8b&#xff09;\u7b80\u5355\u76f4\u89c2&#xff1b;RRF \u7b49\u878d\u5408\u4e5f\u5e38\u89c1&#xff0c;\u9002\u5408\u8de8\u6a21\u6001\/\u8de8\u901a\u9053\u7684\u7ed3\u679c\u5408\u5e76\u3002(Elastic)<\/li>\n<li>\u53ef\u89c2\u6d4b\u4e0e\u97e7\u6027&#xff1a;8.19\/9.1 \u589e\u5f3a\u4e86 ES|QL \u7684\u53ef\u89c2\u6d4b\u4e0e\u5bb9\u9519\u80fd\u529b&#xff0c;\u9002\u5408\u5728\u5927\u89c4\u6a21\u67e5\u8be2\u4e2d\u843d\u5730\u3002(Elastic)<\/li>\n<\/ul>\n<h3>\u4e03\u3001\u5e38\u89c1\u5751\u4f4d<\/h3>\n<ul>\n<li>\u5fd8\u4e86 _score&#xff1a;\u6ca1\u5199 METADATA _score &#043; SORT _score DESC \u65f6&#xff0c;\u54ea\u6015\u7528\u4e86 MATCH\/QSTR&#xff0c;\u4e5f\u53ea\u662f\u5728\u8fc7\u6ee4\u3002(Elastic)<\/li>\n<li>\u591a\u503c\u5b57\u6bb5&#xff1a;ES|QL \u7684\u641c\u7d22\u51fd\u6570\u5929\u7136\u652f\u6301\u591a\u503c\u5b57\u6bb5&#xff08;\u5982 tags \u5217\u8868&#xff09;&#xff0c;\u6bd4\u65e9\u671f\u7684\u201c\u6309 keyword \u8fc7\u6ee4\u201d\u66f4\u5408\u9002\u3002(Elastic)<\/li>\n<li>\u8bed\u4e49\u53ec\u56de\u671f\u671b\u8fc7\u9ad8&#xff1a;semantic_text \u9ed8\u8ba4\u884c\u4e3a\u5f88\u5f3a&#xff0c;\u4f46\u8d28\u91cf\u4ecd\u4f9d\u8d56\u5e95\u5c42\u6a21\u578b\u4e0e\u6570\u636e\u57df&#xff1b;\u5fc5\u8981\u65f6\u7ed3\u5408\u6df7\u5408\u68c0\u7d22\u7a33\u4f4f\u67e5\u5168\u7387\u3002(Elastic)<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u7ed9\u51fa\u5f53\u524d\u7d22\u5f15 mapping&#xff08;\u5c24\u5176\u662f\u6587\u672c\u5b57\u6bb5\u4e0e\u662f\u5426\u8981\u505a\u8bed\u4e49&#xff09;&#xff0c;\u6211\u53ef\u4ee5\u6309\u4f60\u7684\u4e1a\u52a1\u573a\u666f&#xff0c;\u76f4\u63a5\u4ea7\u51fa\u53ef\u6267\u884c\u7684 ES|QL \u67e5\u8be2\u6a21\u677f&#xff08;\u8fc7\u6ee4&#043;\u641c\u7d22&#043;\u6392\u5e8f&#043;\u6df7\u5408\u6743\u91cd&#xff09;\u4ee5\u53ca\u4e00\u5957AB \u5bf9\u6bd4\u7684\u8bc4\u4f30\u6307\u6807\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb498\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf15\u6b21\u3002ES|QL \u8ba9\u4f60\u5728\u4e00\u6761\u67e5\u8be2\u91cc\u540c\u65f6\u5b8c\u6210\u201c\u5148\u8fc7\u6ee4\u3001\u540e\u641c\u7d22\u201d\u7684\u6d41\u7a0b\uff1a\u7528 WHERE \u505a\u8303\u56f4\/\u7cbe\u786e\u6761\u4ef6\u8fc7\u6ee4\uff0c\u518d\u7528 MATCH\/MATCH_PHRASE\u3001QSTR() \u6216 KQL() \u505a\u5168\u6587\u5339\u914d\uff1b\u82e5\u8981\u76f8\u5173\u6027\u6392\u5e8f\uff0c\u5fc5\u987b\u663e\u5f0f\u52a0\u4e0a METADATA _score \u5e76 SORT _score DESC\uff0c\u5426\u5219\u53ea\u662f\u8fc7\u6ee4\u4e0d\u8ba1\u5206\u3002\u7ed3\u5408 semantic_text \u5b57\u6bb5\u8fd8\u80fd\u76f4\u63a5\u505a\u8bed\u4e49\u68c0\u7d22\uff0c\u5e76\u4e0e\u8bcd\u6cd5\u68c0\u7d22\u6309\u6743\u91cd\u6df7\u5408\uff0c\u65e2\u4fdd\u8bc1\u67e5\u5168\u7387\u53c8\u517c\u987e\u7cbe\u51c6\u5ea6\uff0c\u9002\u5408\u628a\u73b0\u6709 Kibana \u67e5\u8be2\u5e73\u6ed1\u8fc1\u5230 ES|QL\uff0c\u5728\u5927\u89c4\u6a21\u6570\u636e\u4e0a\u83b7\u5f97\u66f4\u53ef\u63a7\u7684\u641c\u7d22\u4f53\u9a8c\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1299,99,2215,43,4988],"topic":[],"class_list":["post-50912","post","type-post","status-publish","format-standard","hentry","category-server","tag-elasticsearch","tag-java","tag-2215","tag-43","tag-4988"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/50912.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb498\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf15\u6b21\u3002ES|QL \u8ba9\u4f60\u5728\u4e00\u6761\u67e5\u8be2\u91cc\u540c\u65f6\u5b8c\u6210\u201c\u5148\u8fc7\u6ee4\u3001\u540e\u641c\u7d22\u201d\u7684\u6d41\u7a0b\uff1a\u7528 WHERE \u505a\u8303\u56f4\/\u7cbe\u786e\u6761\u4ef6\u8fc7\u6ee4\uff0c\u518d\u7528 MATCH\/MATCH_PHRASE\u3001QSTR() \u6216 KQL() \u505a\u5168\u6587\u5339\u914d\uff1b\u82e5\u8981\u76f8\u5173\u6027\u6392\u5e8f\uff0c\u5fc5\u987b\u663e\u5f0f\u52a0\u4e0a METADATA _score \u5e76 SORT _score DESC\uff0c\u5426\u5219\u53ea\u662f\u8fc7\u6ee4\u4e0d\u8ba1\u5206\u3002\u7ed3\u5408 semantic_text \u5b57\u6bb5\u8fd8\u80fd\u76f4\u63a5\u505a\u8bed\u4e49\u68c0\u7d22\uff0c\u5e76\u4e0e\u8bcd\u6cd5\u68c0\u7d22\u6309\u6743\u91cd\u6df7\u5408\uff0c\u65e2\u4fdd\u8bc1\u67e5\u5168\u7387\u53c8\u517c\u987e\u7cbe\u51c6\u5ea6\uff0c\u9002\u5408\u628a\u73b0\u6709 Kibana \u67e5\u8be2\u5e73\u6ed1\u8fc1\u5230 ES|QL\uff0c\u5728\u5927\u89c4\u6a21\u6570\u636e\u4e0a\u83b7\u5f97\u66f4\u53ef\u63a7\u7684\u641c\u7d22\u4f53\u9a8c\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50912.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T06:34:16+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50912.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50912.html\",\"name\":\"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T06:34:16+00:00\",\"dateModified\":\"2025-08-10T06:34:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50912.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50912.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50912.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/50912.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb498\u6b21\uff0c\u70b9\u8d5e6\u6b21\uff0c\u6536\u85cf15\u6b21\u3002ES|QL \u8ba9\u4f60\u5728\u4e00\u6761\u67e5\u8be2\u91cc\u540c\u65f6\u5b8c\u6210\u201c\u5148\u8fc7\u6ee4\u3001\u540e\u641c\u7d22\u201d\u7684\u6d41\u7a0b\uff1a\u7528 WHERE \u505a\u8303\u56f4\/\u7cbe\u786e\u6761\u4ef6\u8fc7\u6ee4\uff0c\u518d\u7528 MATCH\/MATCH_PHRASE\u3001QSTR() \u6216 KQL() \u505a\u5168\u6587\u5339\u914d\uff1b\u82e5\u8981\u76f8\u5173\u6027\u6392\u5e8f\uff0c\u5fc5\u987b\u663e\u5f0f\u52a0\u4e0a METADATA _score \u5e76 SORT _score DESC\uff0c\u5426\u5219\u53ea\u662f\u8fc7\u6ee4\u4e0d\u8ba1\u5206\u3002\u7ed3\u5408 semantic_text \u5b57\u6bb5\u8fd8\u80fd\u76f4\u63a5\u505a\u8bed\u4e49\u68c0\u7d22\uff0c\u5e76\u4e0e\u8bcd\u6cd5\u68c0\u7d22\u6309\u6743\u91cd\u6df7\u5408\uff0c\u65e2\u4fdd\u8bc1\u67e5\u5168\u7387\u53c8\u517c\u987e\u7cbe\u51c6\u5ea6\uff0c\u9002\u5408\u628a\u73b0\u6709 Kibana \u67e5\u8be2\u5e73\u6ed1\u8fc1\u5230 ES|QL\uff0c\u5728\u5927\u89c4\u6a21\u6570\u636e\u4e0a\u83b7\u5f97\u66f4\u53ef\u63a7\u7684\u641c\u7d22\u4f53\u9a8c\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/50912.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T06:34:16+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/50912.html","url":"https:\/\/www.wsisp.com\/helps\/50912.html","name":"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T06:34:16+00:00","dateModified":"2025-08-10T06:34:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50912.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50912.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50912.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7528 ES|QL \u505a\u641c\u7d22\u4ece\u8fc7\u6ee4\u5230\u76f8\u5173\u6027\u3001\u518d\u5230\u8bed\u4e49\u4e0e\u6df7\u5408\u68c0\u7d22"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=50912"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50912\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50912"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}