{"id":956,"date":"2020-06-21T13:02:12","date_gmt":"2020-06-21T04:02:12","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=956"},"modified":"2020-08-01T19:46:26","modified_gmt":"2020-08-01T10:46:26","slug":"elasticsearch-%ec%b6%94%ea%b0%80%ec%84%a4%ec%a0%95","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=956","title":{"rendered":"ElasticSearch \ucd94\uac00\uc124\uc815"},"content":{"rendered":"<h1>ElasticSearch \ucd94\uac00\uc124\uc815<\/h1>\n<p>\uc544\ub798\uc5d0\ub294 <a href=\"\/wordpress\/?p=902\">\ud615\ud0dc\uc18c\ubd84\uc11d\uae30 \uc124\uc815<\/a>, <a href=\"\/wordpress\/?p=935\">JDBC \uc5f0\ub3d9<\/a> \uc744 \uae30\ucd08\ub85c \ucd5c\uc885\uc801\uc73c\ub85c \uc815\ub9ac\ud558\ub294 \uae00\uc785\ub2c8\ub2e4.<\/p>\n<h2>\uc0ac\uc804 \ucd94\uac00<\/h2>\n<h3>\uc0ac\uc6a9\uc790 \uc0ac\uc804<\/h3>\n<p>\ubcf5\ud569\uba85\uc0ac\ub294 <code>+<\/code> \ub97c \uc774\uc6a9\ud574 \ub4f1\ub85d\ud569\ub2c8\ub2e4. <code>+<\/code> \ub294 <code>\\+<\/code> \ub85c \ub4f1\ub85d\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">sudo vi \/etc\/elasticsearch\/user_dict.csv\n\ud150\ubc14\uc774\ud150,-1000\n\uc5e0\ub514,-100\n\uc544\uc774\ud3f0+\ucf00\uc774\uc2a4,-1000\nc\\+\\+<\/code><\/pre>\n<h3>\uc720\uc758\uc5b4 \uc0ac\uc804<\/h3>\n<pre><code class=\"language-bash\">sudo vi \/etc\/elasticsearch\/synonyms.txt\n\ube14\ub799,\uac80\uc815,black<\/code><\/pre>\n<h3>\ubd88\uc6a9\uc5b4<\/h3>\n<p>\ubd88\uc6a9\uc5b4\uc5d0\ub294 \uc695\uc124 \ub4f1 \uc81c\uac70\ud574\uc57c \ud558\ub294 \ub2e8\uc5b4 \ubfd0\ub9cc \uc544\ub2c8\ub77c, \ud0a4\uc6cc\ub4dc\ub85c\uc11c\uc758 \uac00\uce58\uac00 \uc5c6\ub294 \ub2e8\uc5b4(\ub300\ubd80\ubd84\uc758 \ubb38\uc11c\uc5d0 \ub4f1\uc7a5\ud558\ub294 \ud754\ud55c \ub2e8\uc5b4)\ub3c4 \ub4f1\ub85d\ud558\uba74 \uac80\uc0c9\uc131\ub2a5\uc774 \ud5a5\uc0c1\ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">sudo vi \/etc\/elasticsearch\/stopwords.txt\n\uc695\uc124\ub4e4\n\uac1c\uc790\uc2dd<\/code><\/pre>\n<h2>\uc778\ub371\uc2a4 \uc124\uc815<\/h2>\n<pre><code class=\"language-bash\">curl -XDELETE http:\/\/localhost:9200\/items?pretty\n\ncurl -XPUT http:\/\/localhost:9200\/items?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;settings&quot; : {\n    &quot;number_of_shards&quot;: &quot;5&quot;,\n    &quot;number_of_replicas&quot;: &quot;1&quot;,\n    &quot;index&quot;:{\n      &quot;analysis&quot;:{\n        &quot;analyzer&quot;:{\n          &quot;korean&quot;:{\n            &quot;type&quot;:&quot;custom&quot;,\n            &quot;tokenizer&quot;:&quot;seunjeon_default_tokenizer&quot;,\n            &quot;filter&quot; : [&quot;lowercase&quot;, &quot;synonym&quot;, &quot;stopword&quot;]\n          }\n        },\n        &quot;filter&quot; : {\n          &quot;synonym&quot; : {\n            &quot;type&quot; : &quot;synonym&quot;,\n            &quot;synonyms_path&quot; : &quot;synonyms.txt&quot;\n          },\n          &quot;stopword&quot; : {\n            &quot;type&quot; : &quot;stop&quot;,\n            &quot;stopwords_path&quot; : &quot;stopwords.txt&quot;\n          }\n        },\n        &quot;tokenizer&quot;: {\n          &quot;seunjeon_default_tokenizer&quot;: {\n            &quot;index_eojeol&quot;: &quot;true&quot;,\n            &quot;user_dict_path&quot;: &quot;user_dict.csv&quot;,\n            &quot;index_poses&quot;: [\n                &quot;UNK&quot;, &quot;EP&quot;, &quot;I&quot;, &quot;J&quot;, &quot;M&quot;,\n                &quot;N&quot;, &quot;SL&quot;, &quot;SH&quot;, &quot;SN&quot;, &quot;VCP&quot;,\n                &quot;XP&quot;, &quot;XS&quot;, &quot;XR&quot;\n            ],\n            &quot;decompound&quot;: &quot;true&quot;,\n            &quot;type&quot;: &quot;seunjeon_tokenizer&quot;\n          }\n        }\n      }\n    }\n  },\n  &quot;mappings&quot; : {\n    &quot;_doc&quot; : {\n      &quot;properties&quot; : {\n        &quot;@timestamp&quot; : {\n          &quot;type&quot; : &quot;date&quot;\n        },\n        &quot;itemid&quot; : {\n          &quot;type&quot; : &quot;integer&quot;\n        },\n        &quot;itemname&quot; : {\n          &quot;type&quot; : &quot;text&quot;,\n          &quot;analyzer&quot;: &quot;korean&quot;\n        },\n        &quot;category&quot; : {\n          &quot;type&quot; : &quot;text&quot;,\n          &quot;analyzer&quot;: &quot;korean&quot;\n        },\n        &quot;price&quot; : {\n          &quot;type&quot;: &quot;scaled_float&quot;,\n          &quot;scaling_factor&quot;: 10000\n        },\n        &quot;lastupdate&quot; : {\n          &quot;type&quot; : &quot;date&quot;\n        },\n        &quot;regdate&quot; : {\n          &quot;type&quot; : &quot;date&quot;\n        }\n      }\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XGET http:\/\/localhost:9200\/items\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;match&quot;: {\n      &quot;itemname&quot;: &quot;black\uc544\uc774\ud3f0\ucf00\uc774\uc2a4&quot;\n    }\n  }\n}&#039;\n\ncurl -XGET http:\/\/localhost:9200\/items\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;match&quot;: {\n      &quot;itemname&quot;: &quot;\ud654\uc774\ud2b8 \uc544\uc774\ud3f0 \ucf00\uc774\ube14&quot;\n    }\n  },\n  &quot;explain&quot;: true\n}&#039;\n\ncurl -XGET http:\/\/localhost:9200\/items\/_analyze?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n    &quot;analyzer&quot;:&quot;korean&quot;,\n    &quot;text&quot;:&quot;\ud150\ubc14\uc774\ud150 \uc5e0\ub514\uac00 \ucd94\ucc9c\ud569\ub2c8\ub2e4.&quot;\n}&#039;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ElasticSearch \ucd94\uac00\uc124\uc815 \uc544\ub798\uc5d0\ub294 \ud615\ud0dc\uc18c\ubd84\uc11d\uae30 \uc124\uc815, JDBC \uc5f0\ub3d9 \uc744 \uae30\ucd08\ub85c \ucd5c\uc885\uc801\uc73c\ub85c \uc815\ub9ac\ud558\ub294 \uae00\uc785\ub2c8\ub2e4. \uc0ac\uc804 \ucd94\uac00 \uc0ac\uc6a9\uc790 \uc0ac\uc804 \ubcf5\ud569\uba85\uc0ac\ub294 + \ub97c \uc774\uc6a9\ud574 \ub4f1\ub85d\ud569\ub2c8\ub2e4. + \ub294 \\+ \ub85c \ub4f1\ub85d\ud569\ub2c8\ub2e4. sudo vi \/etc\/elasticsearch\/user_dict.csv \ud150\ubc14\uc774\ud150,-1000 \uc5e0\ub514,-100 \uc544\uc774\ud3f0+\ucf00\uc774\uc2a4,-1000 c\\+\\+ \uc720\uc758\uc5b4 \uc0ac\uc804 sudo vi \/etc\/elasticsearch\/synonyms.txt \ube14\ub799,\uac80\uc815,black \ubd88\uc6a9\uc5b4 \ubd88\uc6a9\uc5b4\uc5d0\ub294 \uc695\uc124 \ub4f1 \uc81c\uac70\ud574\uc57c \ud558\ub294 \ub2e8\uc5b4 \ubfd0\ub9cc \uc544\ub2c8\ub77c, \ud0a4\uc6cc\ub4dc\ub85c\uc11c\uc758 \uac00\uce58\uac00 \uc5c6\ub294 \ub2e8\uc5b4(\ub300\ubd80\ubd84\uc758 \ubb38\uc11c\uc5d0 \ub4f1\uc7a5\ud558\ub294 \ud754\ud55c\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=956\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-elasticsearch"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=956"}],"version-history":[{"count":11,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":1209,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/956\/revisions\/1209"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}