{"id":114852,"date":"2026-10-10T12:00:51","date_gmt":"2026-10-10T04:00:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/114852.html"},"modified":"2026-10-10T12:00:51","modified_gmt":"2026-10-10T04:00:51","slug":"elasticsearch%ef%bc%9a%e5%8e%9f%e7%90%86%e3%80%81docker-%e5%ae%89%e8%a3%85%e4%b8%8e%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/114852.html","title":{"rendered":"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4"},"content":{"rendered":"<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5047\u8bbe\u4f60\u505a\u4e86\u4e00\u4e2a\u535a\u5ba2\u7f51\u7ad9&#xff0c;\u91cc\u9762\u6709\u5341\u4e07\u7bc7\u6587\u7ae0\u3002\u8bfb\u8005\u8f93\u5165\u201cDocker \u5b89\u88c5\u201d&#xff0c;\u5e0c\u671b\u627e\u5230\u6807\u9898\u6216\u6b63\u6587\u4e2d\u76f8\u5173\u7684\u5185\u5bb9&#xff0c;\u8fd8\u60f3\u6309\u5206\u7c7b\u7b5b\u9009\u3001\u6309\u53d1\u5e03\u65f6\u95f4\u6392\u5e8f\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u65f6&#xff0c;\u641c\u7d22\u529f\u80fd\u9700\u8981\u505a\u7684\u4e8b\u60c5\u5c31\u6bd4\u201c\u67e5\u627e\u67d0\u4e2a\u5b57\u6bb5\u7b49\u4e8e\u67d0\u4e2a\u503c\u201d\u591a\u4e86&#xff1a;\u7406\u89e3\u5173\u952e\u8bcd\u3001\u627e\u5230\u76f8\u5173\u6587\u7ae0\u3001\u51b3\u5b9a\u8c01\u6392\u5728\u524d\u9762&#xff0c;\u518d\u628a\u7ed3\u679c\u5206\u9875\u8fd4\u56de\u3002Elasticsearch \u5c31\u662f\u5e38\u7528\u4e8e\u5904\u7406\u8fd9\u7c7b\u9700\u6c42\u7684\u5de5\u5177\u3002\u5f53\u7136&#xff0c;\u5728\u4f01\u4e1a\u7ea7\u9879\u76ee\u4e2d\u4e5f\u4f1a\u5e38\u5e38\u5c06ES\u4f5c\u4e3a\u65e5\u5fd7\u7cfb\u7edf\u642d\u5efa\u7684\u4e2d\u95f4\u4ef6\u3002<\/p>\n<h2 style=\"background-color:transparent\">\u4e00\u3001Elasticsearch \u5230\u5e95\u662f\u4ec0\u4e48<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Elasticsearch&#xff0c;\u901a\u5e38\u7b80\u79f0 ES&#xff0c;\u662f\u57fa\u4e8e Apache Lucene \u7684\u641c\u7d22\u4e0e\u5206\u6790\u5f15\u64ce\u3002Lucene \u63d0\u4f9b\u5e95\u5c42\u68c0\u7d22\u80fd\u529b&#xff0c;Elasticsearch \u5c06\u8fd9\u4e9b\u80fd\u529b\u5c01\u88c5\u6210 HTTP \u63a5\u53e3&#xff0c;\u5e76\u652f\u6301\u591a\u53f0\u673a\u5668\u534f\u540c\u5904\u7406\u6570\u636e\u3002\u5e38\u89c1\u7528\u9014\u5305\u62ec\u6587\u7ae0\u641c\u7d22\u3001\u5546\u54c1\u641c\u7d22\u548c\u65e5\u5fd7\u67e5\u8be2\u3002\u5b83\u4e5f\u80fd\u505a\u7edf\u8ba1&#xff0c;\u4f8b\u5982\u201c\u6bcf\u4e2a\u5206\u7c7b\u6709\u591a\u5c11\u7bc7\u6587\u7ae0\u201d\u201c\u67d0\u4e2a\u65f6\u95f4\u6bb5\u51fa\u73b0\u4e86\u591a\u5c11\u6b21\u9519\u8bef\u201d\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5b83\u4e0e MySQL \u7684\u4fa7\u91cd\u70b9\u4e0d\u540c\u3002MySQL \u5e38\u7528\u4e8e\u4fdd\u5b58\u8ba2\u5355\u3001\u8d26\u6237\u7b49\u4e1a\u52a1\u6570\u636e&#xff0c;\u5904\u7406\u4e8b\u52a1\u548c\u5173\u7cfb\u67e5\u8be2&#xff1b;Elasticsearch \u5e38\u7528\u4e8e\u5168\u6587\u68c0\u7d22\u3001\u76f8\u5173\u6027\u6392\u5e8f\u548c\u641c\u7d22\u5206\u6790\u3002\u6570\u636e\u5e93\u672c\u8eab\u4e5f\u6709\u5168\u6587\u68c0\u7d22\u80fd\u529b&#xff0c;\u662f\u5426\u9700\u8981\u5f15\u5165 ES&#xff0c;\u8981\u770b\u5b9e\u9645\u9700\u6c42\u548c\u7ef4\u62a4\u6210\u672c\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u4e00\u822c\u5e38\u89c1\u7684\u505a\u6cd5&#xff1a;\u4e1a\u52a1\u6570\u636e\u4ecd\u5b58\u653e\u5728 MySQL&#xff0c;\u5c06\u9700\u8981\u641c\u7d22\u7684\u5b57\u6bb5\u540c\u6b65\u5230 ES\u3002\u641c\u7d22\u8bf7\u6c42\u67e5\u8be2 ES&#xff0c;\u4ea4\u6613\u64cd\u4f5c\u7ee7\u7eed\u7531\u4e1a\u52a1\u6570\u636e\u5e93\u5904\u7406\u3002\u8fd9\u6837\u4f1a\u589e\u52a0\u6570\u636e\u540c\u6b65\u5de5\u4f5c&#xff0c;\u8fd8\u8981\u8003\u8651\u540c\u6b65\u5931\u8d25\u548c\u5ef6\u8fdf&#xff0c;\u4e0d\u80fd\u671f\u5f85\u4e24\u8fb9\u5929\u7136\u4e00\u81f4\u3002<\/p>\n<p>\u5148\u7406\u89e3\u51e0\u4e2a\u6982\u5ff5<\/p>\n<table>\n<tr>\u6982\u5ff5\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td style=\"width:219px\">\u6587\u6863&#xff08;Document&#xff09;<\/td>\n<td style=\"width:470px\">\u4e00\u6761 JSON \u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td style=\"width:219px\">\u7d22\u5f15&#xff08;Index&#xff09;<\/td>\n<td style=\"width:470px\">\u4e00\u7ec4\u6587\u6863\u53ca\u5176\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td style=\"width:219px\">Mapping<\/td>\n<td style=\"width:470px\">\u5b57\u6bb5\u7c7b\u578b\u548c\u7d22\u5f15\u65b9\u5f0f\u7684\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td style=\"width:219px\">\u4e3b\u5206\u7247&#xff08;Primary shard&#xff09;<\/td>\n<td style=\"width:470px\">\u7d22\u5f15\u6570\u636e\u7684\u4e00\u90e8\u5206&#xff0c;\u6bcf\u4e2a\u5206\u7247\u662f\u4e00\u4e2a Lucene \u7d22\u5f15<\/td>\n<\/tr>\n<tr>\n<td style=\"width:219px\">\u526f\u672c\u5206\u7247&#xff08;Replica shard&#xff09;<\/td>\n<td style=\"width:470px\">\u4e3b\u5206\u7247\u7684\u526f\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"width:219px\">\u8282\u70b9&#xff08;Node&#xff09;<\/td>\n<td style=\"width:470px\">\u4e00\u4e2a Elasticsearch \u5b9e\u4f8b<\/td>\n<\/tr>\n<tr>\n<td style=\"width:219px\">\u96c6\u7fa4&#xff08;Cluster&#xff09;<\/td>\n<td style=\"width:470px\">\u534f\u540c\u5de5\u4f5c\u7684\u591a\u4e2a\u8282\u70b9&#xff0c;\u4e5f\u53ef\u4ee5\u53ea\u6709\u4e00\u4e2a\u8282\u70b9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e8c\u3001\u5b83\u4e3a\u4ec0\u4e48\u53ef\u4ee5\u5feb\u901f\u627e\u5230\u4f60\u60f3\u8981\u7684\u5185\u5bb9<\/h2>\n<h3>1\u3001\u5012\u6392\u7d22\u5f15&#xff1a;\u4ece\u201c\u8bcd\u201d\u627e\u5230\u201c\u6587\u7ae0\u201d<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5047\u8bbe\u6709\u4e09\u7bc7\u6587\u7ae0&#xff0c;\u6807\u9898\u5206\u522b\u662f&#xff1a;<\/p>\n<table>\n<tr>\u6587\u6863 ID\u6807\u9898<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>Docker \u5b89\u88c5\u6559\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Elasticsearch \u5b89\u88c5\u6559\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Docker \u7f51\u7edc\u6392\u67e5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6309\u201c\u6587\u7ae0\u00a0\u2192\u00a0\u6807\u9898\u201d\u4fdd\u5b58\u5185\u5bb9&#xff0c;\u5f88\u5bb9\u6613\u56de\u7b54\u201c\u7b2c 1 \u7bc7\u6587\u7ae0\u53eb\u4ec0\u4e48\u201d\u3002\u4f46\u8bfb\u8005\u641c\u7d22\u201cDocker\u201d\u65f6&#xff0c;\u9700\u8981\u53cd\u8fc7\u6765\u56de\u7b54&#xff1a;\u201c\u54ea\u4e9b\u6587\u7ae0\u5305\u542b\u8fd9\u4e2a\u8bcd&#xff1f;\u201d\u3002\u4e3a\u6b64&#xff0c;\u53ef\u4ee5\u63d0\u524d\u6574\u7406\u4e00\u4efd\u67e5\u627e\u8868&#xff1a;<\/p>\n<table>\n<tr>\u8bcd\u5305\u542b\u5b83\u7684\u6587\u6863 ID<\/tr>\n<tbody>\n<tr>\n<td>docker<\/td>\n<td>1\u30013<\/td>\n<\/tr>\n<tr>\n<td>elasticsearch<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u88c5<\/td>\n<td>1\u30012<\/td>\n<\/tr>\n<tr>\n<td>\u6559\u7a0b<\/td>\n<td>1\u30012<\/td>\n<\/tr>\n<tr>\n<td>\u7f51\u7edc<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>\u6392\u67e5<\/td>\n<td>3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u5c31\u662f\u5012\u6392\u7d22\u5f15\u7684\u57fa\u672c\u601d\u8def&#xff1a;\u8bb0\u5f55\u4e00\u4e2a\u8bcd\u51fa\u73b0\u5728\u54ea\u4e9b\u6587\u6863\u4e2d\u3002\u641c\u7d22 Docker \u65f6&#xff0c;\u5c31\u80fd\u5148\u627e\u5230\u6587\u6863 1 \u548c 3&#xff0c;\u4e0d\u5fc5\u6bcf\u6b21\u9010\u7bc7\u626b\u63cf\u5168\u6587\u3002\u641c\u7d22\u201cDocker \u5b89\u88c5\u201d\u65f6&#xff0c;\u5982\u679c\u8981\u6c42\u4e24\u4e2a\u8bcd\u90fd\u51fa\u73b0&#xff0c;\u5c31\u53d6\u4e24\u4e2a\u5217\u8868\u7684\u4ea4\u96c6&#xff0c;\u5f97\u5230\u6587\u6863 1&#xff1b;\u5982\u679c\u5141\u8bb8\u4efb\u610f\u4e00\u4e2a\u8bcd\u51fa\u73b0&#xff0c;\u5c31\u4f1a\u6709\u66f4\u591a\u5019\u9009\u7ed3\u679c&#xff0c;\u518d\u6839\u636e\u76f8\u5173\u6027\u6392\u5e8f\u3002<\/p>\n<h3>2\u3001\u5206\u8bcd&#xff1a;\u5148\u628a\u53e5\u5b50\u53d8\u6210\u53ef\u641c\u7d22\u7684\u8bcd<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5efa\u7acb\u5012\u6392\u7d22\u5f15\u524d&#xff0c;ES \u8981\u5148\u5904\u7406\u6587\u672c&#xff0c;\u8fd9\u4e2a\u8fc7\u7a0b\u53eb\u5206\u6790&#xff0c;\u901a\u5e38\u5305\u542b\u5206\u8bcd\u3001\u5927\u5c0f\u5199\u8f6c\u6362\u7b49\u6b65\u9aa4\u3002\u8d1f\u8d23\u8fd9\u4e9b\u5de5\u4f5c\u7684\u914d\u7f6e\u53eb\u5206\u6790\u5668&#xff08;Analyzer&#xff09;\u3002\u4f8b\u5982&#xff0c;\u6807\u51c6\u5206\u6790\u5668\u4f1a\u628a\u00a0Docker Install Guide\u5904\u7406\u6210\u00a0docker\u3001install\u3001guide\u8fd9\u6837\u7684\u8bcd\u3002\u540e\u9762\u5b89\u88c5\u597d\u73af\u5883&#xff0c;\u53ef\u4ee5\u4eb2\u81ea\u67e5\u770b&#xff1a;<\/p>\n<p>POST \/_analyze { \u00a0 &#034;analyzer&#034;: &#034;standard&#034;, \u00a0 &#034;text&#034;: &#034;Docker Install Guide&#034; }<\/p>\n<p>\/\/\u54cd\u5e94\u7ed3\u679c<\/p>\n<p>{ \u00a0\u00a0 \u00a0&#034;tokens&#034;: [{ \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;token&#034;: &#034;docker&#034;, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;start_offset&#034;: 0, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;end_offset&#034;: 6, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;type&#034;: &#034;&lt;ALPHANUM&gt;&#034;, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;position&#034;: 0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0}, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0{ \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;token&#034;: &#034;install&#034;, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;start_offset&#034;: 7, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;end_offset&#034;: 14, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;type&#034;: &#034;&lt;ALPHANUM&gt;&#034;, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;position&#034;: 1 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0}, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0{ \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;token&#034;: &#034;guide&#034;, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;start_offset&#034;: 15, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;end_offset&#034;: 20, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;type&#034;: &#034;&lt;ALPHANUM&gt;&#034;, \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#034;position&#034;: 2 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0} \u00a0\u00a0 \u00a0] }<\/p>\n<h3>3\u3001\u5206\u7247\u4e0e\u526f\u672c&#xff1a;\u6570\u636e\u591a\u4e86&#xff0c;\u600e\u4e48\u5206\u7ed9\u591a\u53f0\u673a\u5668<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e00\u4e2a Elasticsearch \u5b9e\u4f8b\u53eb\u4e00\u4e2a\u8282\u70b9&#xff08;Node&#xff09;&#xff0c;\u591a\u4e2a\u8282\u70b9\u53ef\u4ee5\u7ec4\u6210\u96c6\u7fa4&#xff08;Cluster&#xff09;\u3002\u5f53\u7d22\u5f15\u5f88\u5927\u65f6&#xff0c;\u53ef\u4ee5\u628a\u5b83\u5206\u6210\u51e0\u4efd&#xff0c;\u6bcf\u4e00\u4efd\u53eb\u5206\u7247&#xff08;Shard&#xff09;\u3002\u4f8b\u5982\u628a\u6587\u7ae0\u7d22\u5f15\u5212\u6210 3 \u4e2a\u4e3b\u5206\u7247&#xff0c;\u5404\u81ea\u5b58\u653e\u4e00\u90e8\u5206\u6587\u6863&#xff1b;ES \u901a\u8fc7\u8def\u7531\u51b3\u5b9a\u4e00\u6761\u6587\u6863\u5c5e\u4e8e\u54ea\u4e2a\u4e3b\u5206\u7247\u3002\u526f\u672c\u662f\u4e3b\u5206\u7247\u7684\u590d\u5236\u4ef6\u30023 \u4e2a\u4e3b\u5206\u7247&#xff0c;\u6bcf\u4e2a\u914d\u7f6e 1 \u4e2a\u526f\u672c&#xff0c;\u5c31\u4e00\u5171\u6709 6 \u4e2a\u5206\u7247\u526f\u672c\u5b9e\u4f8b&#xff0c;\u5360\u7528\u7684\u5b58\u50a8\u548c\u8d44\u6e90\u4e5f\u4f1a\u76f8\u5e94\u589e\u52a0\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3b\u5206\u7247\u4e0e\u5b83\u81ea\u5df1\u7684\u526f\u672c\u4e0d\u80fd\u653e\u5728\u540c\u4e00\u4e2a\u8282\u70b9\u4e0a\u3002\u8fd9\u6837\u4e00\u4e2a\u8282\u70b9\u6545\u969c\u65f6&#xff0c;\u96c6\u7fa4\u53ef\u4ee5\u5229\u7528\u5176\u4ed6\u8282\u70b9\u4e0a\u7684\u6709\u6548\u526f\u672c\u6062\u590d\u670d\u52a1&#xff1b;<\/p>\n<h3>4\u3001\u4e00\u6b21\u5199\u5165\u548c\u641c\u7d22&#xff0c;\u5927\u81f4\u7ecf\u5386\u4ec0\u4e48<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5199\u5165\u65f6&#xff0c;\u63a5\u6536\u8bf7\u6c42\u7684\u8282\u70b9\u627e\u5230\u76ee\u6807\u4e3b\u5206\u7247&#xff0c;\u7531\u4e3b\u5206\u7247\u5904\u7406\u5199\u5165&#xff0c;\u518d\u590d\u5236\u5230\u540c\u6b65\u526f\u672c\u3002\u6b63\u5e38\u60c5\u51b5\u4e0b&#xff0c;\u76f8\u5173\u540c\u6b65\u526f\u672c\u5904\u7406\u5b8c\u6210\u540e&#xff0c;\u624d\u5b8c\u6210\u5199\u5165\u786e\u8ba4\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u641c\u7d22\u65f6&#xff0c;\u63a5\u6536\u8bf7\u6c42\u7684\u8282\u70b9\u8d1f\u8d23\u534f\u8c03&#xff0c;\u5c06\u67e5\u8be2\u4ea4\u7ed9\u76f8\u5173\u5206\u7247\u7684\u67d0\u4e2a\u53ef\u7528\u526f\u672c\u6267\u884c&#xff0c;\u518d\u5408\u5e76\u7ed3\u679c\u3001\u83b7\u53d6\u9700\u8981\u7684\u6587\u6863&#xff0c;\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u641c\u7d22\u4e0d\u9700\u8981\u628a\u540c\u4e00\u4efd\u6570\u636e\u7684\u4e3b\u5206\u7247\u548c\u5168\u90e8\u526f\u672c\u90fd\u67e5\u4e00\u904d\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u56e0\u6b64&#xff0c;\u526f\u672c\u65e2\u80fd\u5e2e\u52a9\u5e94\u5bf9\u6545\u969c&#xff0c;\u4e5f\u53ef\u4ee5\u5206\u62c5\u641c\u7d22\u6d41\u91cf&#xff0c;\u4f46\u4f1a\u589e\u52a0\u5b58\u50a8\u548c\u5199\u5165\u590d\u5236\u6210\u672c\u3002&#xff08;\u5176\u5b9e\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u6709\u70b9\u7c7b\u4f3c\u4e8eMYSQL\u4e3b\u4ece\u7ed3\u6784&#xff0c;\u4e3b\u5e93\u5199\u5165\u5b8c\u6210\u540c\u6b65\u5230\u4ece\u5e93&#xff0c;\u540e\u7eed\u8bfb\u53d6\u4e5f\u53ef\u4ee5\u4ece\u4ece\u5e93\u8fdb\u884c\u6570\u636e\u8bfb\u53d6&#xff09;<\/p>\n<h2 id=\"\u4e09\u7528-docker-\u542f\u52a8\u5355\u8282\u70b9\u73af\u5883\">\u4e09\u3001\u7528 Docker \u542f\u52a8\u5355\u8282\u70b9\u73af\u5883<\/h2>\n<h3>1\u3001\u51c6\u5907\u8fd0\u884c\u73af\u5883<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5148\u5b89\u88c5\u9002\u5408\u64cd\u4f5c\u7cfb\u7edf\u7684\u00a0Docker Engine \u6216 Docker Desktop&#xff0c;\u786e\u8ba4\u547d\u4ee4\u53ef\u7528&#xff1a;<\/p>\n<p>docker version <\/p>\n<h3 id=\"2-\u521b\u5efa\u7f51\u7edc\u548c\u6301\u4e45\u5316\u5377\">2\u3001 \u521b\u5efa\u7f51\u7edc\u548c\u6301\u4e45\u5316\u5377<\/h3>\n<p>\u4ee5\u4e0b\u547d\u4ee4\u5728 Bash \u6216 Zsh \u4e2d\u6267\u884c\u3002\u5148\u521b\u5efa\u4e00\u4e2a\u5de5\u4f5c\u76ee\u5f55&#xff0c;\u518d\u51c6\u5907\u4e13\u7528\u7f51\u7edc\u4e0e\u6570\u636e\u5377&#xff1a;<\/p>\n<p>mkdir -p elasticsearch-lab<br \/>\ncd elasticsearch-lab<\/p>\n<p>export STACK_VERSION&#061;8.18.6<\/p>\n<p>docker network create es-lab-net<br \/>\ndocker volume create es-lab-data<br \/>\ndocker volume create es-lab-config<\/p>\n<p>docker pull docker.elastic.co\/elasticsearch\/elasticsearch:${STACK_VERSION} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e24\u4e2a\u5377\u5206\u522b\u4fdd\u5b58\u7d22\u5f15\u6570\u636e&#xff0c;\u4ee5\u53ca\u8282\u70b9\u914d\u7f6e\u4e0e\u8bc1\u4e66\u3002\u8fd9\u91cc\u7684\u914d\u7f6e\u5377\u5c5e\u4e8e\u5f53\u524d\u8282\u70b9&#xff0c;\u4e0d\u8981\u8ba9\u591a\u4e2a\u8282\u70b9\u5171\u4eab\u540c\u4e00\u4e2a\u914d\u7f6e\u5377\u3002<\/p>\n<h3 id=\"3-\u542f\u52a8-elasticsearch\">3\u3001\u542f\u52a8 Elasticsearch<\/h3>\n<p>docker run -dit \\\\<br \/>\n  &#8211;name es-lab \\\\<br \/>\n  &#8211;hostname es-lab \\\\<br \/>\n  &#8211;network es-lab-net \\\\<br \/>\n  &#8211;restart unless-stopped \\\\<br \/>\n  &#8211;memory 2g \\\\<br \/>\n  &#8211;ulimit nofile&#061;65535:65535 \\\\<br \/>\n  &#8211;log-driver json-file \\\\<br \/>\n  &#8211;log-opt max-size&#061;20m \\\\<br \/>\n  &#8211;log-opt max-file&#061;5 \\\\<br \/>\n  -p 127.0.0.1:9200:9200 \\\\<br \/>\n  -e discovery.type&#061;single-node \\\\<br \/>\n  -v es-lab-data:\/usr\/share\/elasticsearch\/data \\\\<br \/>\n  -v es-lab-config:\/usr\/share\/elasticsearch\/config \\\\<br \/>\n  docker.elastic.co\/elasticsearch\/elasticsearch:${STACK_VERSION} <\/p>\n<p>\u8fd9\u6bb5\u914d\u7f6e\u4e2d&#xff0c;\u6709\u51e0\u4e2a\u5730\u65b9\u503c\u5f97\u7406\u89e3&#xff1a;<\/p>\n<ul>\n<li>discovery.type&#061;single-node\u00a0\u7528\u4e8e\u5355\u8282\u70b9\u5b9e\u9a8c\u73af\u5883&#xff1b;\u7ec4\u5efa\u591a\u8282\u70b9\u96c6\u7fa4\u65f6\u9700\u8981\u91cd\u65b0\u89c4\u5212\u53d1\u73b0\u4e0e\u5b89\u5168\u914d\u7f6e\u3002<\/li>\n<li>127.0.0.1:9200:9200\u00a0\u53ea\u628a REST API \u53d1\u5e03\u5230\u5bbf\u4e3b\u673a\u56de\u73af\u5730\u5740\u3002\u8282\u70b9\u95f4\u901a\u4fe1\u4f7f\u7528\u7684\u00a09300\u00a0\u7aef\u53e3\u4e0d\u9700\u8981\u5728\u672c\u793a\u4f8b\u4e2d\u53d1\u5e03\u3002<\/li>\n<li>\u6570\u636e\u5377\u8ba9\u6570\u636e\u72ec\u7acb\u4e8e\u5bb9\u5668\u751f\u547d\u5468\u671f\u3002\u914d\u7f6e\u5377\u4fdd\u7559\u9996\u6b21\u542f\u52a8\u751f\u6210\u7684\u8bc1\u4e66\u3001\u5bc6\u94a5\u5e93\u548c\u914d\u7f6e&#xff1b;\u7a7a\u547d\u540d\u5377\u9996\u6b21\u6302\u8f7d\u65f6\u4f1a\u7531 Docker \u586b\u5145\u955c\u50cf\u4e2d\u5bf9\u5e94\u76ee\u5f55\u7684\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<h3>4\u3001\u9a8c\u8bc1\u662f\u5426\u542f\u52a8\u6210\u529f<\/h3>\n<p>\u6253\u5f00\u6d4f\u89c8\u5668&#xff0c;\u8bbf\u95ee9200\u5730\u5740&#xff1a;http:\/\/127.0.0.1:9200\/&#xff0c;\u5982\u679c\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee&#xff0c;\u5219\u8868\u793a\u542f\u52a8\u6210\u529f\u3002<\/p>\n<h2>\u56db\u3001\u5e38\u7528\u547d\u4ee4&#xff1a;\u6a21\u62df\u4e00\u4e2a\u5c0f\u4f8b\u5b50<\/h2>\n<p>\u4e3a\u4e86\u65b9\u4fbfES\u7684\u53ef\u89c6\u5316\u7ba1\u7406&#xff0c;\u5efa\u8bae\u5f00\u53d1\u6d4b\u8bd5\u53ef\u4ee5\u4f7f\u7528\u8f7b\u91cf\u7ea7\u7684Elasticvue\u5de5\u5177&#xff0c;\u5982\u679c\u662f\u6b63\u5f0f\u73af\u5883\u53ef\u4ee5\u4f7f\u7528\u529f\u80fd\u5f3a\u5927\u7684Kibana\u5de5\u5177&#xff1a;<span class=\"link-card-box\"><span class=\"link-title\">https:\/\/www.elastic.co\/cn\/kibana\/<\/span><span class=\"link-link\"><img decoding=\"async\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261010040050-6ac9b87270c28.png\" \/>https:\/\/www.elastic.co\/cn\/kibana\/<\/span><\/span><\/p>\n<h3>1\u3001\u521b\u5efa\u7d22\u5f15<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u63a7\u5236\u53f0\u8bf7\u6c42\u7531\u201c\u65b9\u6cd5\u3001\u8def\u5f84\u3001\u8bf7\u6c42\u4f53\u201d\u7ec4\u6210\u3002\u4f8b\u5982\u00a0PUT \/articles-v1\u00a0\u8868\u793a\u5411\u8be5\u8def\u5f84\u53d1\u9001 PUT \u8bf7\u6c42&#xff0c;\u540e\u9762\u7684 JSON \u63cf\u8ff0\u7d22\u5f15\u914d\u7f6e\u3002\u547d\u4ee4\u4e2d\u7684\u00a0\/\u00a0\u662f\u63a5\u53e3\u8def\u5f84&#xff0c;\u4e0d\u662f\u672c\u5730\u6587\u4ef6\u76ee\u5f55\u3002<\/p>\n<p>PUT \/articles-v1<br \/>\n\/\/\u8bf7\u6c42\u53c2\u6570<br \/>\n{<br \/>\n  &#034;settings&#034;: {<br \/>\n    &#034;number_of_shards&#034;: 1,<br \/>\n    &#034;number_of_replicas&#034;: 0<br \/>\n  },<br \/>\n  &#034;mappings&#034;: {<br \/>\n    &#034;properties&#034;: {<br \/>\n      &#034;title&#034;: { &#034;type&#034;: &#034;text&#034; },<br \/>\n      &#034;category&#034;: { &#034;type&#034;: &#034;keyword&#034; },<br \/>\n      &#034;published_at&#034;: { &#034;type&#034;: &#034;date&#034; },<br \/>\n      &#034;views&#034;: { &#034;type&#034;: &#034;long&#034; }<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n\/\/\u54cd\u5e94\u53c2\u6570<br \/>\n{<br \/>\n    &#034;acknowledged&#034;: true,<br \/>\n    &#034;shards_acknowledged&#034;: true,<br \/>\n    &#034;index&#034;: &#034;articles-v1&#034;<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u4e2a\u7d22\u5f15\u7528\u4e00\u4e2a\u4e3b\u5206\u7247\u3001\u96f6\u526f\u672c&#xff0c;\u9002\u5408\u5355\u8282\u70b9\u5b66\u4e60\u3002\u751f\u4ea7\u73af\u5883\u5e94\u6309\u53ef\u7528\u6027\u8981\u6c42\u914d\u7f6e\u526f\u672c&#xff0c;\u5e76\u63d0\u4f9b\u80fd\u591f\u627f\u8f7d\u526f\u672c\u7684\u5176\u4ed6\u8282\u70b9\u3002\u63d0\u524d\u5b9a\u4e49 Mapping&#xff0c;\u53ef\u4ee5\u907f\u514d\u65e5\u671f\u3001\u6570\u5b57\u88ab\u9519\u8bef\u8bc6\u522b\u6210\u5b57\u7b26\u4e32\u3002\u67e5\u770b\u914d\u7f6e&#xff1a;<\/p>\n<p>GET \/articles-v1\/_mapping<\/p>\n<p>GET \/articles-v1\/_settings<\/p>\n<h3>2\u3001\u5199\u5165\u6587\u6863&#xff1a;\u7ed9\u6587\u7ae0\u4e00\u4e2a ID<\/h3>\n<p>PUT \/articles-v1\/_doc\/1?refresh&#061;wait_for<br \/>\n\/\/\u8bf7\u6c42\u53c2\u6570<br \/>\n{<br \/>\n  &#034;title&#034;: &#034;Docker \u5b89\u88c5\u6559\u7a0b&#034;,<br \/>\n  &#034;category&#034;: &#034;\u8fd0\u7ef4&#034;,<br \/>\n  &#034;published_at&#034;: &#034;2026-10-01T10:00:00&#043;08:00&#034;,<br \/>\n  &#034;views&#034;: 120<br \/>\n}<br \/>\n\/\/\u54cd\u5e94\u53c2\u6570<br \/>\n{<br \/>\n    &#034;_index&#034;: &#034;articles-v1&#034;,<br \/>\n    &#034;_id&#034;: &#034;1&#034;,<br \/>\n    &#034;_version&#034;: 1,<br \/>\n    &#034;result&#034;: &#034;created&#034;,<br \/>\n    &#034;_shards&#034;: {<br \/>\n        &#034;total&#034;: 1,<br \/>\n        &#034;successful&#034;: 1,<br \/>\n        &#034;failed&#034;: 0<br \/>\n    },<br \/>\n    &#034;_seq_no&#034;: 0,<br \/>\n    &#034;_primary_term&#034;: 1<br \/>\n} <\/p>\n<ul>\n<li>_id&#xff1a;\u6587\u6863ID&#xff0c;\u5411\u540c\u4e00\u7d22\u5f15\u3001\u540c\u4e00 ID \u518d\u6b21\u6267\u884c\u8fd9\u4e2a PUT&#xff0c;\u4f1a\u66ff\u6362\u8be5\u6587\u6863&#xff0c;\u800c\u4e0d\u662f\u65b0\u589e\u7b2c\u4e8c\u6761\u3002<\/li>\n<li>\u5982\u679c\u53ea\u5141\u8bb8\u65b0\u5efa\u3001\u4e0d\u5141\u8bb8\u8986\u76d6&#xff0c;\u4f7f\u7528\u00a0PUT \/articles-v1\/_create\/1&#xff1b;ID \u5df2\u5b58\u5728\u65f6\u4f1a\u8fd4\u56de\u51b2\u7a81\u3002\u8ba9 ES \u81ea\u52a8\u751f\u6210 ID&#xff0c;\u5219\u4f7f\u7528\u00a0POST \/articles-v1\/_doc\u3002<\/li>\n<li>refresh&#061;wait_for\u00a0\u7528\u4e8e\u65b9\u4fbf\u540e\u7eed\u641c\u7d22\u9a8c\u8bc1<\/li>\n<\/ul>\n<h3>3\u3001\u6839\u636e\u00a0ID \u8bfb\u53d6\u6587\u7ae0<\/h3>\n<p>GET \/articles-v1\/_doc\/1<br \/>\n\/\/\u54cd\u5e94\u53c2\u6570<br \/>\n{<br \/>\n&#034;_index&#034;: &#034;articles-v1&#034;,<br \/>\n&#034;_id&#034;: &#034;1&#034;,<br \/>\n&#034;_version&#034;: 3,<br \/>\n&#034;_seq_no&#034;: 2,<br \/>\n&#034;_primary_term&#034;: 1,<br \/>\n&#034;found&#034;: true,<br \/>\n&#034;_source&#034;: {<br \/>\n&#034;title&#034;: &#034;Docker \u5b89\u88c5\u6559\u7a0b&#034;,<br \/>\n&#034;category&#034;: &#034;\u8fd0\u7ef4&#034;,<br \/>\n&#034;published_at&#034;: &#034;2026-10-01T10:00:00&#043;08:00&#034;,<br \/>\n&#034;views&#034;: 120<br \/>\n}<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u54cd\u5e94\u4e2d\u7684\u00a0_source\u00a0\u5305\u542b\u539f\u59cb\u4e1a\u52a1\u5b57\u6bb5&#xff0c;found\u00a0\u8868\u793a\u662f\u5426\u627e\u5230\u6587\u6863\u3002<\/p>\n<h3>4\u3001\u6279\u91cf\u5199\u5165&#xff1a;\u4e00\u6b21\u6dfb\u52a0\u591a\u7bc7\u6587\u7ae0<\/h3>\n<p>POST \/articles-v1\/_bulk?refresh&#061;wait_for<br \/>\n{&#034;index&#034;:{&#034;_id&#034;:&#034;2&#034;}}<br \/>\n{&#034;title&#034;:&#034;Elasticsearch \u5b89\u88c5\u6559\u7a0b&#034;,&#034;category&#034;:&#034;\u641c\u7d22&#034;,&#034;published_at&#034;:&#034;2026-10-02T10:00:00&#043;08:00&#034;,&#034;views&#034;:80}<br \/>\n{&#034;index&#034;:{&#034;_id&#034;:&#034;3&#034;}}<br \/>\n{&#034;title&#034;:&#034;Docker \u7f51\u7edc\u6392\u67e5&#034;,&#034;category&#034;:&#034;\u8fd0\u7ef4&#034;,&#034;published_at&#034;:&#034;2026-10-03T10:00:00&#043;08:00&#034;,&#034;views&#034;:200} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Bulk \u4f7f\u7528 NDJSON&#xff0c;\u5373\u4e00\u884c\u4e00\u4e2a JSON\u3002\u4e0a\u4f8b\u6bcf\u4e24\u884c\u662f\u4e00\u7ec4&#xff1a;\u7b2c\u4e00\u884c\u8bf4\u660e\u64cd\u4f5c\u548c ID&#xff0c;\u7b2c\u4e8c\u884c\u63d0\u4f9b\u6587\u6863\u3002\u901a\u8fc7 curl \u6216\u7a0b\u5e8f\u53d1\u9001\u65f6&#xff0c;\u8bf7\u6c42\u4f53\u6700\u540e\u4e5f\u8981\u4ee5\u6362\u884c\u7b26\u7ed3\u675f&#xff0c;\u5185\u5bb9\u7c7b\u578b\u4f7f\u7528\u00a0application\/x-ndjson\u3002<\/p>\n<h3>5\u3001\u5168\u6587\u641c\u7d22&#xff1a;\u627e\u6807\u9898\u5305\u542b Docker \u7684\u6587\u7ae0<\/h3>\n<p>POST \/articles-v1\/_search<br \/>\n\/\/\u8bf7\u6c42\u53c2\u6570<br \/>\n{<br \/>\n  &#034;query&#034;: {<br \/>\n    &#034;match&#034;: {<br \/>\n      &#034;title&#034;: &#034;Docker&#034;<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n\/\/\u54cd\u5e94\u53c2\u6570<br \/>\n{<br \/>\n  &#034;took&#034;: 29,<br \/>\n  &#034;timed_out&#034;: false,<br \/>\n  &#034;_shards&#034;: {<br \/>\n    &#034;total&#034;: 1,<br \/>\n    &#034;successful&#034;: 1,<br \/>\n    &#034;skipped&#034;: 0,<br \/>\n    &#034;failed&#034;: 0<br \/>\n  },<br \/>\n  &#034;hits&#034;: {<br \/>\n    &#034;total&#034;: {<br \/>\n      &#034;value&#034;: 2,<br \/>\n      &#034;relation&#034;: &#034;eq&#034;<br \/>\n    },<br \/>\n    &#034;max_score&#034;: 0.4700036,<br \/>\n    &#034;hits&#034;: [<br \/>\n      {<br \/>\n        &#034;_index&#034;: &#034;articles-v1&#034;,<br \/>\n        &#034;_id&#034;: &#034;1&#034;,<br \/>\n        &#034;_score&#034;: 0.4700036,<br \/>\n        &#034;_source&#034;: {<br \/>\n          &#034;title&#034;: &#034;Docker \u5b89\u88c5\u6559\u7a0b&#034;,<br \/>\n          &#034;category&#034;: &#034;\u8fd0\u7ef4&#034;,<br \/>\n          &#034;published_at&#034;: &#034;2026-10-01T10:00:00&#043;08:00&#034;,<br \/>\n          &#034;views&#034;: 120<br \/>\n        }<br \/>\n      },<br \/>\n      {<br \/>\n        &#034;_index&#034;: &#034;articles-v1&#034;,<br \/>\n        &#034;_id&#034;: &#034;3&#034;,<br \/>\n        &#034;_score&#034;: 0.4700036,<br \/>\n        &#034;_source&#034;: {<br \/>\n          &#034;title&#034;: &#034;Docker \u7f51\u7edc\u6392\u67e5&#034;,<br \/>\n          &#034;category&#034;: &#034;\u8fd0\u7ef4&#034;,<br \/>\n          &#034;published_at&#034;: &#034;2026-10-03T10:00:00&#043;08:00&#034;,<br \/>\n          &#034;views&#034;: 200<br \/>\n        }<br \/>\n      }<br \/>\n    ]<br \/>\n  }<br \/>\n} <\/p>\n<p>match\u00a0\u4f1a\u5206\u6790\u641c\u7d22\u6587\u672c&#xff0c;\u518d\u67e5\u627e\u5339\u914d\u7684\u6587\u6863\u3002\u5728\u5f53\u524d\u6837\u4f8b\u4e2d&#xff0c;\u5e94\u5339\u914d\u6587\u7ae0 1 \u548c 3\u3002\u8fd4\u56de\u7ed3\u679c\u4e3b\u8981\u770b\u4e09\u5904&#xff1a;<\/p>\n<table>\n<tr>\u5b57\u6bb5\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>hits.total<\/td>\n<td>\u5339\u914d\u603b\u6570\u53ca\u5176\u8ba1\u6570\u5173\u7cfb&#xff1b;\u5927\u7ed3\u679c\u96c6\u53ef\u80fd\u53ea\u662f\u4e0b\u754c<\/td>\n<\/tr>\n<tr>\n<td>hits.hits<\/td>\n<td>\u5f53\u524d\u8fd4\u56de\u7684\u6587\u6863\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>_score<\/td>\n<td>\u76f8\u5173\u6027\u5206\u6570&#xff1b;\u9ed8\u8ba4\u641c\u7d22\u901a\u5e38\u6309\u5206\u6570\u4ece\u9ad8\u5230\u4f4e\u8fd4\u56de<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>6\u3001\u7cbe\u786e\u7b5b\u9009&#xff1a;\u53ea\u770b\u8fd0\u7ef4\u7c7b\u6587\u7ae0<\/h3>\n<p>POST \/articles-v1\/_search<br \/>\n{<br \/>\n  &#034;query&#034;: {<br \/>\n    &#034;bool&#034;: {<br \/>\n      &#034;filter&#034;: [<br \/>\n        { &#034;term&#034;: { &#034;category&#034;: &#034;\u8fd0\u7ef4&#034; } }<br \/>\n      ]<br \/>\n    }<br \/>\n  }<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0term\u00a0\u5339\u914d\u5b57\u6bb5\u7d22\u5f15\u4e2d\u7684\u7cbe\u786e\u8bcd\u9879&#xff0c;\u9002\u5408\u8fd9\u91cc\u7684\u00a0keyword\u00a0\u5206\u7c7b\u5b57\u6bb5\u3002filter\u00a0\u7528\u4e8e\u5224\u65ad\u201c\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\u201d&#xff0c;\u4e0d\u8ba1\u7b97\u76f8\u5173\u6027\u5f97\u5206\u3002<\/p>\n<h3>7\u3001\u6392\u5e8f\u4e0e\u5206\u9875&#xff1a;\u6309\u6d4f\u89c8\u91cf\u53d6\u524d\u4e24\u7bc7<\/h3>\n<p>POST \/articles-v1\/_search<br \/>\n{<br \/>\n  &#034;query&#034;: { &#034;match_all&#034;: {} },<br \/>\n  &#034;sort&#034;: [<br \/>\n    { &#034;views&#034;: &#034;desc&#034; }<br \/>\n  ],<br \/>\n  &#034;from&#034;: 0,<br \/>\n  &#034;size&#034;: 2,<br \/>\n  &#034;_source&#034;: [&#034;title&#034;, &#034;views&#034;]<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0from \u662f\u8df3\u8fc7\u591a\u5c11\u6761&#xff0c;size \u662f\u672c\u6b21\u53d6\u591a\u5c11\u6761&#xff0c;_source \u9650\u5b9a\u8fd4\u56de\u54ea\u4e9b\u4e1a\u52a1\u5b57\u6bb5\u3002\u7b2c\u4e8c\u9875\u53ef\u4ee5\u628a from \u6539\u4e3a 2\u3002<\/p>\n<h3>8\u3001\u4fee\u6539\u6587\u6863&#xff1a;\u53ea\u66f4\u65b0\u6d4f\u89c8\u91cf<\/h3>\n<p>POST \/articles-v1\/_update\/1?refresh&#061;wait_for<br \/>\n{<br \/>\n  &#034;doc&#034;: {<br \/>\n    &#034;views&#034;: 180<br \/>\n  }<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u4f1a\u628a\u6d4f\u89c8\u91cf\u8bbe\u7f6e\u4e3a 180&#xff0c;\u5176\u4ed6\u5b57\u6bb5\u4fdd\u7559\u3002\u5b83\u4e0e\u524d\u9762\u7684\u00a0PUT \/_doc\/1\u00a0\u5168\u91cf\u66ff\u6362\u4e0d\u540c\u3002<\/p>\n<h3>9\u3001\u00a0\u5220\u9664\u6570\u636e&#xff1a;\u5206\u6e05\u6587\u6863\u548c\u7d22\u5f15<\/h3>\n<p>\u5220\u9664\u4e00\u6761ID\u4e3a3\u7684\u6587\u6863&#xff1a;<\/p>\n<p>DELETE \/articles-v1\/_doc\/3?refresh&#061;wait_for<\/p>\n<p>\u5220\u9664\u7d22\u5f15&#xff08;\u7d22\u5f15\u4e0b\u7684\u6240\u6709\u6587\u6863\u90fd\u4f1a\u88ab\u5220\u9664&#xff09;&#xff1a;<\/p>\n<p>DELETE \/articles-v1<\/p>\n<h2>\u4e94\u3001\u5e38\u7528\u547d\u4ee4\u901f\u67e5<\/h2>\n<table>\n<tr>\u76ee\u7684\u547d\u4ee4<\/tr>\n<tbody>\n<tr>\n<td>\u67e5\u770b\u7248\u672c\u4e0e\u57fa\u672c\u4fe1\u606f<\/td>\n<td>GET \/<\/td>\n<\/tr>\n<tr>\n<td>\u68c0\u67e5\u5206\u8bcd\u7ed3\u679c<\/td>\n<td>POST \/_analyze&#xff0c;\u9644\u5206\u6790\u5668\u548c\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td>\u521b\u5efa\u7d22\u5f15<\/td>\n<td>PUT \/articles-v1&#xff0c;\u9644 settings \u4e0e mappings<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5b57\u6bb5\u7c7b\u578b<\/td>\n<td>GET \/articles-v1\/_mapping<\/td>\n<\/tr>\n<tr>\n<td>\u5199\u5165\u6216\u66ff\u6362\u6587\u6863<\/td>\n<td>PUT \/articles-v1\/_doc\/1&#xff0c;\u9644\u5b8c\u6574\u6587\u6863<\/td>\n<\/tr>\n<tr>\n<td>\u53ea\u5141\u8bb8\u65b0\u5efa<\/td>\n<td>PUT \/articles-v1\/_create\/1&#xff0c;\u9644\u6587\u6863<\/td>\n<\/tr>\n<tr>\n<td>\u6309 ID \u67e5\u8be2<\/td>\n<td>GET \/articles-v1\/_doc\/1<\/td>\n<\/tr>\n<tr>\n<td>\u641c\u7d22<\/td>\n<td>POST \/articles-v1\/_search&#xff0c;\u9644\u67e5\u8be2\u6761\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u7edf\u8ba1\u6587\u6863\u6570\u91cf<\/td>\n<td>GET \/articles-v1\/_count<\/td>\n<\/tr>\n<tr>\n<td>\u5c40\u90e8\u66f4\u65b0<\/td>\n<td>POST \/articles-v1\/_update\/1&#xff0c;\u9644 doc \u6216 script<\/td>\n<\/tr>\n<tr>\n<td>\u6279\u91cf\u64cd\u4f5c<\/td>\n<td>POST \/articles-v1\/_bulk&#xff0c;\u9644 NDJSON<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u4e00\u6761\u6587\u6863<\/td>\n<td>DELETE \/articles-v1\/_doc\/1<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u6574\u4e2a\u7d22\u5f15<\/td>\n<td>DELETE \/articles-v1<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u96c6\u7fa4\u5065\u5eb7<\/td>\n<td>GET \/_cluster\/health<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u516d\u3001\u5c0f\u7ed3<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4ee5\u4e0a\u662f\u672c\u6b21\u5bf9\u4e8eElasticsearch\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4\u7684\u4e00\u4e2a\u4ecb\u7ecd\u548c\u4f7f\u7528&#xff0c;\u6b22\u8fce\u5404\u4f4d\u540c\u5b66\u4ea4\u6d41\u5b66\u4e60&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5047\u8bbe\u4f60\u505a\u4e86\u4e00\u4e2a\u535a\u5ba2\u7f51\u7ad9&#xff0c;\u91cc\u9762\u6709\u5341\u4e07\u7bc7\u6587\u7ae0\u3002\u8bfb\u8005\u8f93\u5165\u201cDocker \u5b89\u88c5\u201d&#xff0c;\u5e0c\u671b\u627e\u5230\u6807\u9898\u6216\u6b63\u6587\u4e2d\u76f8\u5173\u7684\u5185\u5bb9&#xff0c;\u8fd8\u60f3\u6309\u5206\u7c7b\u7b5b\u9009\u3001\u6309\u53d1\u5e03\u65f6\u95f4\u6392\u5e8f\u3002 \u8fd9\u65f6&#xff0c;\u641c\u7d22\u529f\u80fd\u9700\u8981\u505a\u7684\u4e8b\u60c5\u5c31\u6bd4\u201c\u67e5\u627e\u67d0\u4e2a\u5b57\u6bb5\u7b49\u4e8e\u67d0\u4e2a\u503c\u201d\u591a\u4e86&#xff1a;\u7406\u89e3\u5173\u952e\u8bcd\u3001\u627e\u5230\u76f8\u5173\u6587\u7ae0\u3001\u51b3\u5b9a\u8c01\u6392\u5728\u524d\u9762&#xff0c;\u518d\u628a\u7ed3\u679c\u5206\u9875\u8fd4\u56de\u3002Elasticsearch \u5c31\u662f\u5e38\u7528\u4e8e\u5904\u7406\u8fd9\u7c7b\u9700\u6c42\u7684\u5de5\u5177\u3002\u5f53\u7136&#xff0c;\u5728\u4f01\u4e1a\u7ea7\u9879\u76ee\u4e2d\u4e5f\u4f1a\u5e38\u5e38\u5c06ES\u4f5c\u4e3a\u65e5\u5fd7\u7cfb\u7edf\u642d\u5efa\u7684\u4e2d\u95f4\u4ef6\u3002 <\/p>\n","protected":false},"author":2,"featured_media":114851,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1299,323,44],"topic":[],"class_list":["post-114852","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-elasticsearch","tag-323","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/114852.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5047\u8bbe\u4f60\u505a\u4e86\u4e00\u4e2a\u535a\u5ba2\u7f51\u7ad9&#xff0c;\u91cc\u9762\u6709\u5341\u4e07\u7bc7\u6587\u7ae0\u3002\u8bfb\u8005\u8f93\u5165\u201cDocker \u5b89\u88c5\u201d&#xff0c;\u5e0c\u671b\u627e\u5230\u6807\u9898\u6216\u6b63\u6587\u4e2d\u76f8\u5173\u7684\u5185\u5bb9&#xff0c;\u8fd8\u60f3\u6309\u5206\u7c7b\u7b5b\u9009\u3001\u6309\u53d1\u5e03\u65f6\u95f4\u6392\u5e8f\u3002 \u8fd9\u65f6&#xff0c;\u641c\u7d22\u529f\u80fd\u9700\u8981\u505a\u7684\u4e8b\u60c5\u5c31\u6bd4\u201c\u67e5\u627e\u67d0\u4e2a\u5b57\u6bb5\u7b49\u4e8e\u67d0\u4e2a\u503c\u201d\u591a\u4e86&#xff1a;\u7406\u89e3\u5173\u952e\u8bcd\u3001\u627e\u5230\u76f8\u5173\u6587\u7ae0\u3001\u51b3\u5b9a\u8c01\u6392\u5728\u524d\u9762&#xff0c;\u518d\u628a\u7ed3\u679c\u5206\u9875\u8fd4\u56de\u3002Elasticsearch \u5c31\u662f\u5e38\u7528\u4e8e\u5904\u7406\u8fd9\u7c7b\u9700\u6c42\u7684\u5de5\u5177\u3002\u5f53\u7136&#xff0c;\u5728\u4f01\u4e1a\u7ea7\u9879\u76ee\u4e2d\u4e5f\u4f1a\u5e38\u5e38\u5c06ES\u4f5c\u4e3a\u65e5\u5fd7\u7cfb\u7edf\u642d\u5efa\u7684\u4e2d\u95f4\u4ef6\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/114852.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-10T04:00:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261010040050-6ac9b87270c28.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/114852.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/114852.html\",\"name\":\"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-10T04:00:51+00:00\",\"dateModified\":\"2026-10-10T04:00:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/114852.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/114852.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/114852.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/114852.html","og_locale":"zh_CN","og_type":"article","og_title":"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5047\u8bbe\u4f60\u505a\u4e86\u4e00\u4e2a\u535a\u5ba2\u7f51\u7ad9&#xff0c;\u91cc\u9762\u6709\u5341\u4e07\u7bc7\u6587\u7ae0\u3002\u8bfb\u8005\u8f93\u5165\u201cDocker \u5b89\u88c5\u201d&#xff0c;\u5e0c\u671b\u627e\u5230\u6807\u9898\u6216\u6b63\u6587\u4e2d\u76f8\u5173\u7684\u5185\u5bb9&#xff0c;\u8fd8\u60f3\u6309\u5206\u7c7b\u7b5b\u9009\u3001\u6309\u53d1\u5e03\u65f6\u95f4\u6392\u5e8f\u3002 \u8fd9\u65f6&#xff0c;\u641c\u7d22\u529f\u80fd\u9700\u8981\u505a\u7684\u4e8b\u60c5\u5c31\u6bd4\u201c\u67e5\u627e\u67d0\u4e2a\u5b57\u6bb5\u7b49\u4e8e\u67d0\u4e2a\u503c\u201d\u591a\u4e86&#xff1a;\u7406\u89e3\u5173\u952e\u8bcd\u3001\u627e\u5230\u76f8\u5173\u6587\u7ae0\u3001\u51b3\u5b9a\u8c01\u6392\u5728\u524d\u9762&#xff0c;\u518d\u628a\u7ed3\u679c\u5206\u9875\u8fd4\u56de\u3002Elasticsearch \u5c31\u662f\u5e38\u7528\u4e8e\u5904\u7406\u8fd9\u7c7b\u9700\u6c42\u7684\u5de5\u5177\u3002\u5f53\u7136&#xff0c;\u5728\u4f01\u4e1a\u7ea7\u9879\u76ee\u4e2d\u4e5f\u4f1a\u5e38\u5e38\u5c06ES\u4f5c\u4e3a\u65e5\u5fd7\u7cfb\u7edf\u642d\u5efa\u7684\u4e2d\u95f4\u4ef6\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/114852.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-10T04:00:51+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261010040050-6ac9b87270c28.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/114852.html","url":"https:\/\/www.wsisp.com\/helps\/114852.html","name":"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-10T04:00:51+00:00","dateModified":"2026-10-10T04:00:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/114852.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/114852.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/114852.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Elasticsearch\uff1a\u539f\u7406\u3001Docker \u5b89\u88c5\u4e0e\u5e38\u7528\u547d\u4ee4"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/114852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=114852"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/114852\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/114851"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=114852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=114852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=114852"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=114852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}