{"id":1308,"date":"2022-09-15T10:22:01","date_gmt":"2022-09-15T02:22:01","guid":{"rendered":"http:\/\/175.24.184.226\/?p=1308"},"modified":"2022-09-15T10:22:01","modified_gmt":"2022-09-15T02:22:01","slug":"elasticsearch%e9%85%8d%e7%bd%aeik%e5%88%86%e8%af%8d%e5%99%a8","status":"publish","type":"post","link":"\/?p=1308","title":{"rendered":"Elasticsearch\u914d\u7f6eIK\u5206\u8bcd\u5668"},"content":{"rendered":"<h1>Elasticsearch\u914d\u7f6eIK\u5206\u8bcd\u5668<\/h1>\n<p>Elasticsearch \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u3001RESTful \u98ce\u683c\u7684\u641c\u7d22\u548c\u6570\u636e\u5206\u6790\u5f15\u64ce\uff0c\u80fd\u591f\u89e3\u51b3\u4e0d\u65ad\u6d8c\u73b0\u51fa\u7684\u5404\u79cd\u7528\u4f8b\u3002 \u4f5c\u4e3a Elastic Stack \u7684\u6838\u5fc3\uff0c\u5b83\u96c6\u4e2d\u5b58\u50a8\u60a8\u7684\u6570\u636e\uff0c\u5e2e\u52a9\u60a8\u53d1\u73b0\u610f\u6599\u4e4b\u4e2d\u4ee5\u53ca\u610f\u6599\u4e4b\u5916\u7684\u60c5\u51b5\u3002<\/p>\n<p><img src=\"http:\/\/www.javacui.com\/ueditor\/php\/upload\/image\/20220209\/1644367583319721.jpg\" alt=\"img\" \/> <\/p>\n<p>IK Analysis for Elasticsearch\u4e0b\u8f7d\u4e0e\u6587\u6863\uff0c\u8fd9\u91cc\u662f\u56fd\u5185\u4ee3\u7406\u8282\u70b9 <\/p>\n<p><a href=\"https:\/\/gitcode.net\/mirrors\/medcl\/elasticsearch-analysis-ik\">https:\/\/gitcode.net\/mirrors\/medcl\/elasticsearch-analysis-ik<\/a>    <\/p>\n<p><a href=\"https:\/\/github.com\/medcl\/elasticsearch-analysis-ik\">https:\/\/github.com\/medcl\/elasticsearch-analysis-ik<\/a> <\/p>\n<p>IK\u5206\u8bcd\u5668\u6269\u5c55\u8bcd\u505c\u7528\u8bcd<\/p>\n<p><a href=\"http:\/\/www.javacui.com\/tool\/631.html\">http:\/\/www.javacui.com\/tool\/631.html<\/a> <\/p>\n<p>The IK Analysis plugin integrates Lucene IK analyzer (<a href=\"http:\/\/code.google.com\/p\/ik-analyzer\/\">http:\/\/code.google.com\/p\/ik-analyzer\/<\/a>) into elasticsearch, support customized dictionary.<\/p>\n<p>Analyzer: ik_smart , ik_max_word , Tokenizer: ik_smart , ik_max_word<\/p>\n<p><img src=\"http:\/\/www.javacui.com\/ueditor\/php\/upload\/image\/20220616\/1655360068885988.jpg\" alt=\"ikVersions.jpg\" title=\"1655360068885988.jpg\" \/> <\/p>\n<p>\u8fd9\u91cc\u4e0b\u8f7d\u4e86elasticsearch-analysis-ik-8.2.0\u7248\u672c\uff0c\u5c06\u4e0b\u8f7d\u6587\u4ef6\u89e3\u538b\u5230elasticsearch-8.2.2\\plugins\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939ik\uff0c\u5c06\u6587\u4ef6\u653e\u5230\u91cc\u9762\u3002<\/p>\n<p>\u6ce8\u610f\uff0c\u56e0\u4e3a\u524d\u9762\u6211\u4e00\u76f4\u7528\u7684ES\u662f8.2.2\uff0c\u56e0\u6b64\u9700\u8981\u4fee\u6539\u4e0bIK\u7684\u914d\u7f6e\u6765\u9002\u914d\uff0c\u4fee\u6539\u914d\u7f6e\u6587\u4ef6plugin-descriptor.properties<\/p>\n<pre><code># &#039;elasticsearch.version&#039; version of elasticsearch compiled against\n# You will have to release a new version of the plugin for each new\n# elasticsearch release. This version is checked when the plugin\n# is loaded so Elasticsearch will refuse to start in the presence of\n# plugins with the incorrect elasticsearch.version.\nelasticsearch.version=8.2.2<\/code><\/pre>\n<p>\u4fee\u6539\u4e3aES\u5b89\u88c5\u7684\u7248\u672c  <\/p>\n<p>\u91cd\u542f\u540e\u6d4b\u8bd5\u4e00\u4e0b\uff0c\u5728kibana\u5de5\u5177\u4e2d\u8f93\u5165<\/p>\n<pre><code>POST \/\\_analyze \n{\n  &quot;text&quot;: &quot;\u4f60\u597d\uff0c\u6211\u77e5\u9053\u4e86\uff0c\u4e2d\u56fd\u662f\u4e00\u4e2a\u4f1f\u5927\u7684\u7956\u56fd\uff0c\u6211\u7231\u4f60&quot;,\n  &quot;analyzer&quot;: &quot;ik\\_smart&quot;\n}<\/code><\/pre>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<pre><code>{\n  &quot;tokens&quot; : \\[\n    {\n      &quot;token&quot; : &quot;\u4f60\u597d&quot;,\n      &quot;start\\_offset&quot; : 0,\n      &quot;end\\_offset&quot; : 2,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 0\n    },\n    {\n      &quot;token&quot; : &quot;\u6211&quot;,\n      &quot;start\\_offset&quot; : 3,\n      &quot;end\\_offset&quot; : 4,\n      &quot;type&quot; : &quot;CN\\_CHAR&quot;,\n      &quot;position&quot; : 1\n    },\n    {\n      &quot;token&quot; : &quot;\u77e5\u9053\u4e86&quot;,\n      &quot;start\\_offset&quot; : 4,\n      &quot;end\\_offset&quot; : 7,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 2\n    },\n    {\n      &quot;token&quot; : &quot;\u4e2d&quot;,\n      &quot;start\\_offset&quot; : 8,\n      &quot;end\\_offset&quot; : 9,\n      &quot;type&quot; : &quot;CN\\_CHAR&quot;,\n      &quot;position&quot; : 3\n    },\n    {\n      &quot;token&quot; : &quot;\u56fd\u662f&quot;,\n      &quot;start\\_offset&quot; : 9,\n      &quot;end\\_offset&quot; : 11,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 4\n    },\n    {\n      &quot;token&quot; : &quot;\u4e00\u4e2a&quot;,\n      &quot;start\\_offset&quot; : 11,\n      &quot;end\\_offset&quot; : 13,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 5\n    },\n    {\n      &quot;token&quot; : &quot;\u4f1f\u5927&quot;,\n      &quot;start\\_offset&quot; : 13,\n      &quot;end\\_offset&quot; : 15,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 6\n    },\n    {\n      &quot;token&quot; : &quot;\u7684&quot;,\n      &quot;start\\_offset&quot; : 15,\n      &quot;end\\_offset&quot; : 16,\n      &quot;type&quot; : &quot;CN\\_CHAR&quot;,\n      &quot;position&quot; : 7\n    },\n    {\n      &quot;token&quot; : &quot;\u7956\u56fd&quot;,\n      &quot;start\\_offset&quot; : 16,\n      &quot;end\\_offset&quot; : 18,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 8\n    },\n    {\n      &quot;token&quot; : &quot;\u6211\u7231\u4f60&quot;,\n      &quot;start\\_offset&quot; : 19,\n      &quot;end\\_offset&quot; : 22,\n      &quot;type&quot; : &quot;CN\\_WORD&quot;,\n      &quot;position&quot; : 9\n    }\n  \\]\n}<\/code><\/pre>\n<p>\u5b83\u5df2\u7ecf\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f46\u662f\u6709\u4e2a\u95ee\u9898\uff0c\u4e2d\u6587\u7684\u8bcd\u6c47\u5206\u6790\u5e76\u4e0d\u53cb\u597d\u548c\u667a\u80fd\uff0c\u8fd9\u91cc\u5c31\u9700\u8981\u81ea\u884c\u6269\u5c55\u81ea\u5df1\u7684\u8bcd\u6c47\u5e93\u4e86\u3002<\/p>\n<p>\u5728IK\u5206\u8bcd\u5668\u6269\u5c55\u8bcd\u505c\u7528\u8bcd\u6587\u7ae0\u7684\u540e\u9762\uff0c\u5df2\u7ecf\u8bf4\u4e86\u5982\u4f55\u628a\u641c\u72d7\u7684\u5b98\u65b9\u8bcd\u6c47\u5bfc\u5165\u4e3a\u81ea\u5df1\u7684\u8bcd\u6c47\u5e93\uff0c\u53ef\u4ee5\u53c2\u8003\u3002<\/p>\n<p>END<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elasticsearch\u914d\u7f6eIK\u5206\u8bcd\u5668 Elasticsearch \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u3001RESTful \u98ce\u683c\u7684\u641c\u7d22\u548c\u6570\u636e\u5206\u6790\u5f15\u64ce\uff0c\u80fd\u591f\u89e3\u51b3\u4e0d   \u2026 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[95],"tags":[94],"_links":{"self":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts\/1308"}],"collection":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1308"}],"version-history":[{"count":1,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/1308\/revisions"}],"predecessor-version":[{"id":1309,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/1308\/revisions\/1309"}],"wp:attachment":[{"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}