{"id":835,"date":"2024-11-07T09:12:15","date_gmt":"2024-11-07T01:12:15","guid":{"rendered":"https:\/\/fwq.ai\/blog\/835\/"},"modified":"2024-11-07T09:12:15","modified_gmt":"2024-11-07T01:12:15","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-orator-%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%a4%9a%e4%b8%aa-like-%e6%9f%a5%e8%af%a2%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/835\/","title":{"rendered":"\u5982\u4f55\u5728 Orator \u4e2d\u4f7f\u7528\u591a\u4e2a LIKE \u67e5\u8be2\uff1f"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1071\" src=\"https:\/\/fwq.ai\/blog\/wp-content\/uploads\/2024\/11\/172995283327341.jpg\" width=\"800\" height=\"320\" srcset=\"https:\/\/fwq.ai\/blog\/wp-content\/uploads\/2024\/11\/172995283327341.jpg 800w, https:\/\/fwq.ai\/blog\/wp-content\/uploads\/2024\/11\/172995283327341-300x120.jpg 300w, https:\/\/fwq.ai\/blog\/wp-content\/uploads\/2024\/11\/172995283327341-768x307.jpg 768w, https:\/\/fwq.ai\/blog\/wp-content\/uploads\/2024\/11\/172995283327341-670x268.jpg 670w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" title=\"\u5982\u4f55\u5728 Orator \u4e2d\u4f7f\u7528\u591a\u4e2a LIKE \u67e5\u8be2\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728 Orator \u4e2d\u4f7f\u7528\u591a\u4e2a LIKE \u67e5\u8be2\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 python \u7684 orator \u4e2d\u6784\u5efa\u591a\u4e2a like \u67e5\u8be2\uff1f<\/strong><\/p>\n<p>\u539f\u751f sql \u8bed\u53e5\u652f\u6301\u4f7f\u7528 or \u8fd0\u7b97\u7b26\u5c06\u591a\u4e2a like \u67e5\u8be2\u6761\u4ef6\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>select * from `think_user` where  (`name` like '%think%' or `name` like '%php%')<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8981\u5c06\u6b64\u67e5\u8be2\u8f6c\u6362\u4e3a orator\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u6b21\u8d4b\u503c\u65b9\u6cd5\uff1a<\/p>\n<p><strong>and \u903b\u8f91:<\/strong><\/p>\n<pre># \u5b9e\u73b0 and \u903b\u8f91\nsearch = ['%word1%', '%word2%', '%word3%', ...]\ninfo = db.table('full_text')\nfor s in search:\n    info = info.where('title', 'like', s)\nresult = info.get()<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>or \u903b\u8f91:<\/strong><\/p>\n<pre># \u5b9e\u73b0 OR \u903b\u8f91\nsearch = ['%word1%', '%word2%', '%word3%', ...]\ninfo = DB.table('full_text')\nfor s in search:\n    if search.index(s) == 0:\n        info = info.where('title', 'like', s)\n    else:\n        info = info.or_where('title', 'like', s)\nresult = info.get()<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u4e0e\u539f\u751f sql \u8bed\u53e5\u4e0d\u540c\uff0corator \u7684 like \u67e5\u8be2\u4f7f\u7528\u901a\u914d\u7b26 % \u5305\u88f9\u641c\u7d22\u8bcd\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u767e\u5206\u53f7\u5360\u4f4d\u7b26\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728 Orator \u4e2d\u4f7f\u7528\u591a\u4e2a LIKE \u67e5\u8be2\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728 python \u7684 orator \u4e2d\u6784\u5efa\u591a\u4e2a like \u67e5\u8be2\uff1f \u539f\u751f sql \u8bed\u53e5\u652f\u6301\u4f7f\u7528 or \u8fd0\u7b97\u7b26\u5c06\u591a\u4e2a like \u67e5\u8be2\u6761\u4ef6\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u4f8b\u5982\uff1a select * from `think_user` where (`name` like &#8216;%think%&#8217; or `name` like &#8216;%php%&#8217;) \u767b\u5f55\u540e\u590d\u5236 \u8981\u5c06\u6b64\u67e5\u8be2\u8f6c\u6362\u4e3a orator\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u6b21\u8d4b\u503c\u65b9\u6cd5\uff1a and \u903b\u8f91: # \u5b9e\u73b0 and \u903b\u8f91 search = [&#8216;%word1%&#8217;, &#8216;%word2%&#8217;, &#8216;%word3%&#8217;, &#8230;] info = db.table(&#8216;full_text&#8217;) for s in search: info = info.where(&#8216;title&#8217;, &#8216;like&#8217;, s) result = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-835","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=835"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/835\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}