{"id":1101,"date":"2020-07-05T15:25:30","date_gmt":"2020-07-05T06:25:30","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=1101"},"modified":"2025-10-30T13:07:31","modified_gmt":"2025-10-30T04:07:31","slug":"elasticsearch-%ec%9e%90%eb%8f%99%ec%99%84%ec%84%b1-%ea%b5%ac%ed%98%84%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=1101","title":{"rendered":"Elasticsearch \uc790\ub3d9\uc644\uc131(autocomplete) \uad6c\ud604\ud558\uae30"},"content":{"rendered":"<h1>Elasticsearch \uc790\ub3d9\uc644\uc131(autocomplete) \uad6c\ud604\ud558\uae30<\/h1>\n<p>\uc790\ub3d9\uc644\uc131\uc744 \uad6c\ud604\ud558\uae30 \uc704\ud55c \uba87\uba87 \uae30\ub2a5\ub4e4\uc744 \uad6c\ud604\ud574 \ubd05\ub2c8\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=10990\">\uc5ec\uae30<\/a> \uc5d0 Install ElasticSearch 9.x on Windows \uc791\uc131\ud574 \ub193\uc558\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>\ub370\uc774\ud0c0 \uc900\ube44\ud558\uae30<\/h2>\n<pre><code class=\"language-bash\">curl -XDELETE http:\/\/localhost:9200\/auto_complete?pretty -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPUT &#039;http:\/\/localhost:9200\/auto_complete?include_type_name=true&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;mappings&quot;: {\n    &quot;_doc&quot;: {\n      &quot;properties&quot;: {\n        &quot;search_string&quot;: {\n          &quot;type&quot;: &quot;completion&quot;\n        }\n      }\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">vi data.json<\/code><\/pre>\n<pre><code class=\"language-json\">{ &quot;index&quot;:{ &quot;_index&quot; : &quot;auto_complete&quot;, &quot;_type&quot; : &quot;_doc&quot; } }\n{ &quot;search_string&quot;:&quot;\uc140\ud504\ube68\ub798\ubc29&quot;}\n{ &quot;index&quot;:{ &quot;_index&quot; : &quot;auto_complete&quot;, &quot;_type&quot; : &quot;_doc&quot; } }\n{ &quot;search_string&quot;:&quot;\ube68\ub798\uac74\uc870\ub300&quot;}\n{ &quot;index&quot;:{ &quot;_index&quot; : &quot;auto_complete&quot;, &quot;_type&quot; : &quot;_doc&quot; } }\n{ &quot;search_string&quot;:&quot;\ubcfc\ube68\uac04\uc0ac\ucd98\uae30&quot;}\n{ &quot;index&quot;:{ &quot;_index&quot; : &quot;auto_complete&quot;, &quot;_type&quot; : &quot;_doc&quot; } }\n{ &quot;search_string&quot;:&quot;\ube68\ub798\uac74\uc870\uae30&quot;}<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPOST http:\/\/localhost:9200\/_bulk?pretty -H &#039;Content-Type: application\/json&#039; --data-binary @data.json<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPOST &#039;localhost:9200\/auto_complete\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d&#039;{\n  &quot;query&quot;: {\n      &quot;match_all&quot;: {}\n  }\n}&#039;<\/code><\/pre>\n<h2>completion \uc744 \uc774\uc6a9\ud55c \uc790\ub3d9\uc644\uc131<\/h2>\n<p>\ub9e8\uc55e\uc758 \ubb38\uc790\uac00 \ub9e4\uce6d\ub418\ub294 \ub370\uc774\ud0c0\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. \ud558\uc9c0\ub9cc, \uc911\uac04\uc5d0 \ub9e4\uce6d\ub418\ub294 \uac80\uc0c9\uc5b4\ub294 \ud3ec\ud568\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET &#039;localhost:9200\/auto_complete\/_search?pretty&#039; -H &#039;Content-Type: application\/json&#039; -d&#039;{\n  &quot;suggest&quot;: {\n    &quot;search-string-suggest&quot;: {\n      &quot;prefix&quot;: &quot;\ube68&quot;,\n      &quot;completion&quot;: {\n        &quot;field&quot;: &quot;search_string&quot;\n      }\n    }\n  }\n}&#039;<\/code><\/pre>\n<h2>ngram tokenizer \ub97c \uc774\uc6a9\ud55c \uc790\ub3d9\uc644\uc131<\/h2>\n<p>\uc778\ub371\uc2a4 \uc0ad\uc81c \ud6c4 \uc544\ub798 \uba85\ub839\uc73c\ub85c \uc778\ub371\uc2a4\ub97c \uc0c8\ub85c \uc0dd\uc131\ud558\uace0 \ub370\uc774\ud0c0\ub97c \uc785\ub825\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XDELETE http:\/\/localhost:9200\/auto_complete?pretty -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPUT &#039;http:\/\/localhost:9200\/auto_complete?include_type_name=true&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;settings&quot; : {\n    &quot;index&quot;:{\n      &quot;max_ngram_diff&quot;: 50,\n      &quot;analysis&quot;:{\n        &quot;analyzer&quot;:{\n          &quot;my_ngram_analyzer&quot;: {\n            &quot;tokenizer&quot;: &quot;my_ngram_tokenizer&quot;\n          }\n        },\n        &quot;tokenizer&quot;: {\n          &quot;my_ngram_tokenizer&quot;: {\n            &quot;type&quot;: &quot;ngram&quot;,\n            &quot;min_gram&quot;: &quot;1&quot;,\n            &quot;max_gram&quot;: &quot;10&quot;\n          }\n        }\n      }\n    }\n  },\n  &quot;mappings&quot;: {\n    &quot;_doc&quot;: {\n      &quot;properties&quot;: {\n        &quot;search_string&quot;: {\n          &quot;type&quot;: &quot;text&quot;,\n          &quot;fields&quot;: {\n            &quot;ngram&quot;: {\n              &quot;type&quot;: &quot;text&quot;,\n              &quot;analyzer&quot;: &quot;my_ngram_analyzer&quot;\n            }\n          }\n        }\n      }\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPOST http:\/\/localhost:9200\/_bulk?pretty -H &#039;Content-Type: application\/json&#039; --data-binary @data.json<\/code><\/pre>\n<p>\uc544\ub798 \uba85\ub839\uc73c\ub85c \uc790\ub3d9\uc644\uc131\uc774 \uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9\ud558\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET http:\/\/localhost:9200\/auto_complete\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;match&quot;: {\n      &quot;search_string.ngram&quot;: &quot;\ube68&quot;\n    }\n  }\n}&#039;<\/code><\/pre>\n<p><code>\uc140\ud504\ube68\ub798\ubc29<\/code> \uc774 \uac80\uc0c9\uacb0\uacfc\uc5d0 \ud3ec\ud568\ub418\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>Korean Jaso Analyzer \ub97c \uc774\uc6a9\ud55c \uc790\ub3d9\uc644\uc131<\/h2>\n<p><a href=\"https:\/\/github.com\/netcrazy\/elasticsearch-jaso-analyzer\">Korean Jaso Analyzer<\/a> \ub97c \uc774\uc6a9\ud558\uc5ec \ud55c\uae00 \uc790\uc18c\ub2e8\uc704\ub85c \uc790\ub3d9\uc644\uc131\uc774 \ub418\ub3c4\ub85d \uc218\uc815\ud574 \ubd05\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XDELETE http:\/\/localhost:9200\/auto_complete?pretty -H &#039;Content-Type: application\/json&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPUT &#039;http:\/\/localhost:9200\/auto_complete?include_type_name=true&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;settings&quot; : {\n    &quot;index&quot;:{\n      &quot;number_of_replicas&quot;: &quot;0&quot;,\n      &quot;max_ngram_diff&quot;: 50,\n      &quot;analysis&quot;:{\n        &quot;filter&quot;: {\n          &quot;suggest_filter&quot;: {\n            &quot;type&quot;: &quot;ngram&quot;,\n            &quot;min_gram&quot;: 1,\n            &quot;max_gram&quot;: 50\n          }\n        },\n        &quot;analyzer&quot;:{\n          &quot;my_ngram_analyzer&quot;: {\n            &quot;tokenizer&quot;: &quot;my_ngram_tokenizer&quot;\n          },\n          &quot;suggest_search_analyzer&quot;: {\n            &quot;type&quot;: &quot;custom&quot;,\n            &quot;tokenizer&quot;: &quot;jaso_search_tokenizer&quot;\n          },\n          &quot;suggest_index_analyzer&quot;: {\n            &quot;type&quot;: &quot;custom&quot;,\n            &quot;tokenizer&quot;: &quot;jaso_index_tokenizer&quot;,\n            &quot;filter&quot;: [\n              &quot;suggest_filter&quot;\n            ]\n          }\n        },\n        &quot;tokenizer&quot;: {\n          &quot;jaso_search_tokenizer&quot;: {\n            &quot;type&quot;: &quot;jaso_tokenizer&quot;,\n            &quot;mistype&quot;: true,\n            &quot;chosung&quot;: false\n          },\n          &quot;jaso_index_tokenizer&quot;: {\n            &quot;type&quot;: &quot;jaso_tokenizer&quot;,\n            &quot;mistype&quot;: true,\n            &quot;chosung&quot;: true\n          },\n          &quot;my_ngram_tokenizer&quot;: {\n            &quot;type&quot;: &quot;ngram&quot;,\n            &quot;min_gram&quot;: &quot;1&quot;,\n            &quot;max_gram&quot;: &quot;10&quot;\n          }\n        }\n      }\n    }\n  },\n  &quot;mappings&quot;: {\n    &quot;_doc&quot;: {\n      &quot;properties&quot;: {\n        &quot;search_string&quot;: {\n          &quot;type&quot;: &quot;text&quot;,\n          &quot;fields&quot;: {\n            &quot;ngram&quot;: {\n              &quot;type&quot;: &quot;text&quot;,\n              &quot;analyzer&quot;: &quot;my_ngram_analyzer&quot;\n            },\n            &quot;jaso&quot;: {\n              &quot;type&quot;: &quot;text&quot;,\n              &quot;analyzer&quot;: &quot;suggest_index_analyzer&quot;\n            }\n          }\n        }\n      }\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-bash\">curl -XPOST http:\/\/localhost:9200\/_bulk?pretty -H &#039;Content-Type: application\/json&#039; --data-binary @data.json<\/code><\/pre>\n<p><code>\ube68<\/code> \uc774 \ud3ec\ud568\ub41c \uac80\uc0c9\uc5b4\uac00 \uc815\uc0c1\uc801\uc73c\ub85c \ud45c\uc2dc\ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET http:\/\/localhost:9200\/auto_complete\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;match&quot;: {\n      &quot;search_string.ngram&quot;: {\n        &quot;query&quot;: &quot;\ube68&quot;,\n        &quot;analyzer&quot;: &quot;my_ngram_analyzer&quot;\n      }\n    }\n  },\n  &quot;highlight&quot;:{\n    &quot;fields&quot;:{\n      &quot;search_string.ngram&quot;:{}\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-json\">{\n  &quot;took&quot; : 26,\n  &quot;timed_out&quot; : false,\n  &quot;_shards&quot; : {\n    &quot;total&quot; : 1,\n    &quot;successful&quot; : 1,\n    &quot;skipped&quot; : 0,\n    &quot;failed&quot; : 0\n  },\n  &quot;hits&quot; : {\n    &quot;total&quot; : {\n      &quot;value&quot; : 4,\n      &quot;relation&quot; : &quot;eq&quot;\n    },\n    &quot;max_score&quot; : 0.10943023,\n    &quot;hits&quot; : [\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;2sz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.10943023,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\uc140\ud504\ube68\ub798\ubc29&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;\uc140\ud504&lt;em&gt;\ube68&lt;\/em&gt;\ub798\ubc29&quot;\n          ]\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;28z1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.10943023,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\ub300&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;&lt;em&gt;\ube68&lt;\/em&gt;\ub798\uac74\uc870\ub300&quot;\n          ]\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3cz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.10943023,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\uae30&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;&lt;em&gt;\ube68&lt;\/em&gt;\ub798\uac74\uc870\uae30&quot;\n          ]\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3Mz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.0947853,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ubcfc\ube68\uac04\uc0ac\ucd98\uae30&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;\ubcfc&lt;em&gt;\ube68&lt;\/em&gt;\uac04\uc0ac\ucd98\uae30&quot;\n          ]\n        }\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p><code>\ubcfc\ube68\uac04\uc0ac\ucd98\uae30<\/code> \uac00 \uc81c\uc678\ub418\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET http:\/\/localhost:9200\/auto_complete\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;must&quot;: [\n        {\n          &quot;match&quot;: {\n            &quot;search_string.jaso&quot;: {\n              &quot;query&quot;: &quot;\ube68\u3139&quot;,\n              &quot;analyzer&quot;: &quot;suggest_search_analyzer&quot;\n            }\n          }\n        }\n      ],\n      &quot;should&quot;: [\n        {\n          &quot;match&quot;: {\n            &quot;search_string.ngram&quot;: {\n              &quot;query&quot;: &quot;\ube68\u3139&quot;,\n              &quot;analyzer&quot;: &quot;my_ngram_analyzer&quot;\n            }\n          }\n        }\n      ]\n    }\n  },\n  &quot;highlight&quot;:{\n    &quot;fields&quot;:{\n      &quot;search_string.ngram&quot;:{}\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-json\">{\n  &quot;took&quot; : 4,\n  &quot;timed_out&quot; : false,\n  &quot;_shards&quot; : {\n    &quot;total&quot; : 1,\n    &quot;successful&quot; : 1,\n    &quot;skipped&quot; : 0,\n    &quot;failed&quot; : 0\n  },\n  &quot;hits&quot; : {\n    &quot;total&quot; : {\n      &quot;value&quot; : 3,\n      &quot;relation&quot; : &quot;eq&quot;\n    },\n    &quot;max_score&quot; : 0.7075971,\n    &quot;hits&quot; : [\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;2sz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.7075971,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\uc140\ud504\ube68\ub798\ubc29&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;\uc140\ud504&lt;em&gt;\ube68&lt;\/em&gt;\ub798\ubc29&quot;\n          ]\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;28z1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.7075971,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\ub300&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;&lt;em&gt;\ube68&lt;\/em&gt;\ub798\uac74\uc870\ub300&quot;\n          ]\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3cz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.7075971,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\uae30&quot;\n        },\n        &quot;highlight&quot; : {\n          &quot;search_string.ngram&quot; : [\n            &quot;&lt;em&gt;\ube68&lt;\/em&gt;\ub798\uac74\uc870\uae30&quot;\n          ]\n        }\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p><code>\u3143<\/code> \ub9cc \uc785\ub825\ud574\ub3c4 \uac80\uc0c9\uc774 \uc2dc\uc791\ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET http:\/\/localhost:9200\/auto_complete\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;must&quot;: [\n        {\n          &quot;match&quot;: {\n            &quot;search_string.jaso&quot;: {\n              &quot;query&quot;: &quot;\u3143&quot;,\n              &quot;analyzer&quot;: &quot;suggest_search_analyzer&quot;\n            }\n          }\n        }\n      ],\n      &quot;should&quot;: [\n        {\n          &quot;match&quot;: {\n            &quot;search_string.ngram&quot;: {\n              &quot;query&quot;: &quot;\u3143&quot;,\n              &quot;analyzer&quot;: &quot;my_ngram_analyzer&quot;\n            }\n          }\n        }\n      ]\n    }\n  },\n  &quot;highlight&quot;:{\n    &quot;fields&quot;:{\n      &quot;search_string.ngram&quot;:{}\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-json\">{\n  &quot;took&quot; : 2,\n  &quot;timed_out&quot; : false,\n  &quot;_shards&quot; : {\n    &quot;total&quot; : 1,\n    &quot;successful&quot; : 1,\n    &quot;skipped&quot; : 0,\n    &quot;failed&quot; : 0\n  },\n  &quot;hits&quot; : {\n    &quot;total&quot; : {\n      &quot;value&quot; : 4,\n      &quot;relation&quot; : &quot;eq&quot;\n    },\n    &quot;max_score&quot; : 0.20996921,\n    &quot;hits&quot; : [\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3Mz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.20996921,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ubcfc\ube68\uac04\uc0ac\ucd98\uae30&quot;\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;2sz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.20052904,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\uc140\ud504\ube68\ub798\ubc29&quot;\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;28z1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.20052904,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\ub300&quot;\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3cz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.20052904,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\uae30&quot;\n        }\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p><code>\ube68<\/code> \uc744 \ud55c\uc601\uc790\ud310\uc624\ub958\ub85c <code>Qkf<\/code> \ub97c \uc785\ub825\ud574\ub3c4 \uac80\uc0c9\uc774 \ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\">curl -XGET http:\/\/localhost:9200\/auto_complete\/_search?pretty -H &#039;Content-Type: application\/json&#039; -d &#039;{\n  &quot;query&quot;: {\n    &quot;bool&quot;: {\n      &quot;must&quot;: [\n        {\n          &quot;match&quot;: {\n            &quot;search_string.jaso&quot;: {\n              &quot;query&quot;: &quot;Qkf&quot;,\n              &quot;analyzer&quot;: &quot;suggest_search_analyzer&quot;\n            }\n          }\n        }\n      ],\n      &quot;should&quot;: [\n        {\n          &quot;match&quot;: {\n            &quot;search_string.ngram&quot;: {\n              &quot;query&quot;: &quot;Qkf&quot;,\n              &quot;analyzer&quot;: &quot;my_ngram_analyzer&quot;\n            }\n          }\n        }\n      ]\n    }\n  },\n  &quot;highlight&quot;:{\n    &quot;fields&quot;:{\n      &quot;search_string.ngram&quot;:{}\n    }\n  }\n}&#039;<\/code><\/pre>\n<pre><code class=\"language-json\">{\n  &quot;took&quot; : 8,\n  &quot;timed_out&quot; : false,\n  &quot;_shards&quot; : {\n    &quot;total&quot; : 1,\n    &quot;successful&quot; : 1,\n    &quot;skipped&quot; : 0,\n    &quot;failed&quot; : 0\n  },\n  &quot;hits&quot; : {\n    &quot;total&quot; : {\n      &quot;value&quot; : 4,\n      &quot;relation&quot; : &quot;eq&quot;\n    },\n    &quot;max_score&quot; : 0.3533927,\n    &quot;hits&quot; : [\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;2sz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.3533927,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\uc140\ud504\ube68\ub798\ubc29&quot;\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;28z1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.3533927,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\ub300&quot;\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3Mz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.3533927,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ubcfc\ube68\uac04\uc0ac\ucd98\uae30&quot;\n        }\n      },\n      {\n        &quot;_index&quot; : &quot;auto_complete&quot;,\n        &quot;_type&quot; : &quot;_doc&quot;,\n        &quot;_id&quot; : &quot;3cz1HXMB01CMBcId4OTi&quot;,\n        &quot;_score&quot; : 0.3533927,\n        &quot;_source&quot; : {\n          &quot;search_string&quot; : &quot;\ube68\ub798\uac74\uc870\uae30&quot;\n        }\n      }\n    ]\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Elasticsearch \uc790\ub3d9\uc644\uc131(autocomplete) \uad6c\ud604\ud558\uae30 \uc790\ub3d9\uc644\uc131\uc744 \uad6c\ud604\ud558\uae30 \uc704\ud55c \uba87\uba87 \uae30\ub2a5\ub4e4\uc744 \uad6c\ud604\ud574 \ubd05\ub2c8\ub2e4. \uc5ec\uae30 \uc5d0 Install ElasticSearch 9.x on Windows \uc791\uc131\ud574 \ub193\uc558\uc2b5\ub2c8\ub2e4. \ub370\uc774\ud0c0 \uc900\ube44\ud558\uae30 curl -XDELETE http:\/\/localhost:9200\/auto_complete?pretty -H &#039;Content-Type: application\/json&#039; curl -XPUT &#039;http:\/\/localhost:9200\/auto_complete?include_type_name=true&amp;pretty&#039; -H &#039;Content-Type: application\/json&#039; -d &#039;{ &quot;mappings&quot;: { &quot;_doc&quot;: { &quot;properties&quot;: { &quot;search_string&quot;: { &quot;type&quot;: &quot;completion&quot; } } } } }&#039; vi data.json { &quot;index&quot;:{ &quot;_index&quot;\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=1101\">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-1101","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\/1101","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=1101"}],"version-history":[{"count":16,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1101\/revisions"}],"predecessor-version":[{"id":11003,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1101\/revisions\/11003"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}