{"id":5715,"date":"2022-07-16T13:46:39","date_gmt":"2022-07-16T04:46:39","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5715"},"modified":"2022-07-16T20:14:43","modified_gmt":"2022-07-16T11:14:43","slug":"elasticsearch-filter-cache-%ed%85%8c%ec%8a%a4%ed%8a%b8%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5715","title":{"rendered":"Elasticsearch filter cache \ud14c\uc2a4\ud2b8\ud558\uae30"},"content":{"rendered":"<h1>Elasticsearch filter cache \ud14c\uc2a4\ud2b8\ud558\uae30<\/h1>\n<p><a href=\"https:\/\/towardsdatascience.com\/deep-dive-into-querying-elasticsearch-filter-vs-query-full-text-search-b861b06bd4c0\">\ucc38\uc870<\/a><\/p>\n<blockquote>\n<p>\ud544\ud130 \uce90\uc2dc\ub97c \ud14c\uc2a4\ud2b8\ud558\uae30 \uc704\ud574\uc11c\ub294 \ub300\ub7c9\uc758 \ub370\uc774\ud0c0\uac00 \ud544\uc694\ud558\ub2e4.<br \/>\n\uc11c\ubc84 \uba54\ubaa8\ub9ac\ub294 4G \uc774\uc0c1\uc73c\ub85c \ud55c\ub2e4.<\/p>\n<\/blockquote>\n<h2>\ud55c\uc904\uc694\uc57d<\/h2>\n<ol>\n<li>term \ucffc\ub9ac\ub294 \uce90\uc2dc\ub418\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<li>match \ucffc\ub9ac\ub294 value \uac00 numeric\/keyword \uc778\uacbd\uc6b0 \uce90\uc2dc\ub41c\ub2e4.(text \ub294 \uc548\ub41c\ub2e4.)<\/li>\n<li>range \ucffc\ub9ac\ub294 \uce90\uc2dc\ub41c\ub2e4.<\/li>\n<\/ol>\n<h2>\ub370\uc774\ud0c0 \uc900\ube44<\/h2>\n<p><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=3486\">\uc5ec\uae30<\/a> \ub97c \ucc38\uc870\ud574\uc11c \ub370\uc774\ud0c0\ub97c \ub2e4\uc6b4\ubc1b\ub294\ub2e4.<\/p>\n<h2>Elasticsearch \uc124\uce58<\/h2>\n<p><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5711\">\uc5ec\uae30<\/a> \ub97c \ucc38\uc870\ud574 ES \ub97c \uc124\uce58\ud55c\ub2e4.<\/p>\n<h2>kibana \uc124\uce58<\/h2>\n<p>CSV \uc5c5\ub85c\ub4dc \uc218\ub2e8\uc911\uc5d0 \ud0a4\ubc14\ub098\uac00 \uac00\uc7a5 \ud3b8\ud55c \ub4ef \ud558\ub2e4.<\/p>\n<pre><code class=\"language-bash\">sudo apt install kibana\n\nsudo systemctl daemon-reload\nsudo systemctl enable kibana.service\n\nsudo systemctl start kibana.service<\/code><\/pre>\n<p>\ud0a4\ubc14\ub098 \uc6d0\uaca9\uc811\uc18d\uc740 \ud56d\uc0c1 \uc704\ud5d8\ud558\ubbc0\ub85c \uc811\uc18d \uac00\ub2a5\ud55c \uc544\uc774\ud53c\ub97c \uc81c\ud55c\ud560 \uc218\ub2e8\uc744 \uac00\uc9c0\uace0 \uc788\ub294\uac8c \uc88b\ub2e4.<\/p>\n<pre><code class=\"language-bash\">sudo vi \/etc\/kibana\/kibana.yml\n......\nserver.host: &quot;0.0.0.0&quot;\n......<\/code><\/pre>\n<pre><code class=\"language-bash\">sudo systemctl restart kibana.service<\/code><\/pre>\n<h2>\ub370\uc774\ud0c0 \uc5c5\ub85c\ub4dc<\/h2>\n<p>\ud0a4\ubc14\ub098\ub294 100M \uc758 \uc0ac\uc774\uc988 \uc81c\ud55c\uc774 \uc788\uc73c\ubbc0\ub85c,<br \/>\n\ub2e4\uc6b4\ubc1b\uc740 \uc2dd\ub2f9 \ub370\uc774\ud0c0\ub97c \uc5f4\uc5b4 10\ub9cc\uac74 \uc815\ub3c4\ub9cc \ub0a8\uae30\uace0 \ub098\uba38\uc9c0\ub294 \uc0ad\uc81c\ud55c\ub2e4.<br \/>\n\ud30c\uc77c\ud615\uc2dd\uc740 UTF-8 \ub85c \ud55c\ub2e4.<\/p>\n<h2>filter \uce90\uc2dc \ud655\uc778\ud558\uae30<\/h2>\n<pre><code class=\"language-bash\">curl -XGET &#039;http:\/\/localhost:9200\/_nodes\/stats\/indices\/query_cache?human&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n<p>term \ucffc\ub9ac\ub294 \uce90\uc2dc\ub418\uc9c0 \uc54a\ub294\ub2e4.<br \/>\n<a href=\"https:\/\/github.com\/elastic\/elasticsearch\/pull\/27190\">\ucc38\uc870<\/a><\/p>\n<pre><code class=\"language-bash\">curl -XGET &#039;http:\/\/localhost:9200\/test_index\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;filter&quot;: [\n        { &quot;term&quot;: { &quot;\uc0ac\uc5c5\uc7a5\uba85&quot;: &quot;\ub124\ub124\uce58\ud0a8 \ub9c8\uace1\ub098\ub8e8\uc810&quot; } }\n      ]\n    }\n  }\n}&#039;\n\ncurl -XGET &#039;http:\/\/localhost:9200\/_nodes\/stats\/indices\/query_cache?human&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n<p>match \ucffc\ub9ac\uc758 \uacbd\uc6b0 value \uac00 numeric\/keyword \uc778 \uacbd\uc6b0 \uce90\uc2dc\uac00 \ub41c\ub2e4.<br \/>\nvalue \uac00 text \uc778 \uacbd\uc6b0 \uce90\uc2dc\ub418\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<p>\uc544\ub798 \ucffc\ub9ac\ub97c 3-40 \ud68c \ubc18\ubcf5\ud574\uc11c \ud638\ucd9c\ud558\uba74 \uce90\uc2dc\uac00 \uc0dd\uaca8\ub098\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-bash\"># long\ncurl -XGET &#039;http:\/\/localhost:9200\/test_index\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;filter&quot;: [\n        { &quot;match&quot;: { &quot;\ud3d0\uc5c5\uc77c\uc790&quot;: 20220506 } }\n      ]\n    }\n  }\n}&#039;\n\n# keyword\ncurl -XGET &#039;http:\/\/localhost:9200\/test_index\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;filter&quot;: [\n        { &quot;match&quot;: { &quot;\ucd5c\uc885\uc218\uc815\uc2dc\uc810&quot;: &quot;20170918111246&quot; } }\n      ]\n    }\n  }\n}&#039;\n\n# text\ncurl -XGET &#039;http:\/\/localhost:9200\/test_index\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;filter&quot;: [\n        { &quot;match&quot;: { &quot;\ub3c4\ub85c\uba85\uc804\uccb4\uc8fc\uc18c&quot;: &quot;\ub2a5\ub3d9\ub85c&quot; } }\n      ]\n    }\n  }\n}&#039;\n\ncurl -XGET &#039;http:\/\/localhost:9200\/_nodes\/stats\/indices\/query_cache?human&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n<p>range \ucffc\ub9ac\ub294 \uce90\uc2dc\ub41c\ub2e4.<br \/>\n\uc544\ub798 \ucffc\ub9ac\ub97c 3-40 \ud68c \ubc18\ubcf5\ud574\uc11c \ud638\ucd9c\ud558\uba74 \uce90\uc2dc\uac00 \uc0dd\uaca8\ub098\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET &#039;http:\/\/localhost:9200\/test_index\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;filter&quot;: [\n        { &quot;range&quot;: { &quot;\ubc88\ud638&quot;: {\n          &quot;gte&quot;: 50,\n          &quot;lt&quot;: 150\n        } } }\n      ]\n    }\n  }\n}&#039;\n\ncurl -XGET &#039;http:\/\/localhost:9200\/_nodes\/stats\/indices\/query_cache?human&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Elasticsearch filter cache \ud14c\uc2a4\ud2b8\ud558\uae30 \ucc38\uc870 \ud544\ud130 \uce90\uc2dc\ub97c \ud14c\uc2a4\ud2b8\ud558\uae30 \uc704\ud574\uc11c\ub294 \ub300\ub7c9\uc758 \ub370\uc774\ud0c0\uac00 \ud544\uc694\ud558\ub2e4. \uc11c\ubc84 \uba54\ubaa8\ub9ac\ub294 4G \uc774\uc0c1\uc73c\ub85c \ud55c\ub2e4. \ud55c\uc904\uc694\uc57d term \ucffc\ub9ac\ub294 \uce90\uc2dc\ub418\uc9c0 \uc54a\ub294\ub2e4. match \ucffc\ub9ac\ub294 value \uac00 numeric\/keyword \uc778\uacbd\uc6b0 \uce90\uc2dc\ub41c\ub2e4.(text \ub294 \uc548\ub41c\ub2e4.) range \ucffc\ub9ac\ub294 \uce90\uc2dc\ub41c\ub2e4. \ub370\uc774\ud0c0 \uc900\ube44 \uc5ec\uae30 \ub97c \ucc38\uc870\ud574\uc11c \ub370\uc774\ud0c0\ub97c \ub2e4\uc6b4\ubc1b\ub294\ub2e4. Elasticsearch \uc124\uce58 \uc5ec\uae30 \ub97c \ucc38\uc870\ud574 ES \ub97c \uc124\uce58\ud55c\ub2e4. kibana \uc124\uce58 CSV \uc5c5\ub85c\ub4dc \uc218\ub2e8\uc911\uc5d0 \ud0a4\ubc14\ub098\uac00\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=5715\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-5715","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\/5715","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=5715"}],"version-history":[{"count":34,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5715\/revisions"}],"predecessor-version":[{"id":5749,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5715\/revisions\/5749"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}