{"id":2209,"date":"2023-05-03T16:46:46","date_gmt":"2023-05-03T08:46:46","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=2209"},"modified":"2023-05-04T05:42:30","modified_gmt":"2023-05-03T21:42:30","slug":"lucene-learning-part-2-lucene-process-and-building-document-objects","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/05\/03\/lucene-learning-part-2-lucene-process-and-building-document-objects\/","title":{"rendered":"Lucene\u7684\u5b66\u4e60\u7b2c\u4e8c\u7bc7 \u2014 Lucene\u7684\u6d41\u7a0b\u4e0e\u6784\u5efa\u6587\u6863\u5bf9\u8c61"},"content":{"rendered":"<p>\u65e2\u7136Lucene\u662f\u5b9e\u73b0\u5168\u6587\u68c0\u7d22\uff0c\u90a3\u4e48\u660e\u767d\u4ee5\u4e0b\u51e0\u4e2a\u95ee\u9898\uff0c<\/p>\n<ul>\n<li>Lucene\u662f\u4ec0\u4e48\uff1f<\/li>\n<li>Lucene\u5b9e\u73b0\u5168\u6587\u68c0\u7d22\u7684\u6d41\u7a0b\uff1f<\/li>\n<li>\u7d22\u5f15\u5230\u5e95\u662f\u5982\u4f55\u521b\u5efa\u7684\uff1f(Indexing)<\/li>\n<li>\u7d22\u5f15\u91cc\u9762\u5b58\u653e\u7684\u53c8\u662f\u4ec0\u4e48\u4e1c\u897f\uff1f<\/li>\n<li>\u641c\u7d22\u7684\u7684\u65f6\u5019\u53c8\u662f\u5982\u4f55\u53bb\u67e5\u627e\u7d22\u5f15\u7684\uff1f(Search)<\/li>\n<\/ul>\n<p>\u8fd95\u4e2a\u95ee\u9898\u641e\u660e\u767d\u4e86\uff0c\u90a3\u4e48lucene\u5c31\u7b97\u5165\u95e8\u4e86\u3002<\/p>\n<p>1\uff1alucene\u662f\u4ec0\u4e48\uff1f<\/p>\n<p>Lucene\u662f\u4e00\u5806jar\u5305<\/p>\n<p>2\uff1alucene\u7684\u5b9e\u73b0\u5168\u6587\u68c0\u7d22\u7684\u6d41\u7a0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.appblog.cn\/wp-content\/uploads\/2023\/05\/Lucene\u7684\u5b9e\u73b0\u5168\u6587\u68c0\u7d22\u7684\u6d41\u7a0b-1024x728.png\" alt=\"\" \/><\/p>\n<p>\u5176\u5b9e\u5c31\u4e24\u5927\u6d41\u7a0b\uff1a<\/p>\n<pre><code>1:\u7eff\u8272\u8868\u793a\u521b\u5efa\u7d22\u5f15\u8fc7\u7a0b\uff0c\u5305\u62ec\uff1a\n\u91c7\u96c6\u6570\u636e\u3001\u521b\u5efa\u7d22\u5f15\uff08\u4fdd\u5b58\u5230\u7d22\u5f15\u5e93\uff09\n\n2:\u7ea2\u8272\u8868\u793a\u67e5\u8be2\u7d22\u5f15\u8fc7\u7a0b\uff0c\u5305\u62ec\uff1a\n\u5165\u53e3\u63d0\u4ea4\u67e5\u8be2\u8bf7\u6c42\uff08\u67e5\u8be2\u5173\u952e\u5b57\uff09\u3001\u6267\u884c\u67e5\u8be2\uff08\u4ece\u7d22\u5f15\u5e93\u641c\u7d22\uff09<\/code><\/pre>\n<p>\u91c7\u96c6\u6570\u636e\uff1a\u4ece\u4e92\u8054\u7f51\u4e0a\u3001\u6570\u636e\u5e93\u3001\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7b49\u83b7\u53d6\u9700\u8981\u641c\u7d22\u7684\u539f\u59cb\u4fe1\u606f\uff0c\u5982\u4f55\u91c7\u96c6\u6570\u636e\uff1f<\/p>\n<ul>\n<li>1\u3001\u4e92\u8054\u7f51\u4e0a\u7684\u7f51\u9875\uff1a\u53ef\u4ee5\u4f7f\u7528\u722c\u866b\u83b7\u53d6\u6570\u636e\u3002<\/li>\n<li>2\u3001\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\uff1a\u53ef\u4ee5\u76f4\u63a5\u8fde\u63a5\u6570\u636e\u5e93\u7528SQL\u67e5\u8be2\u6570\u636e\u3002<\/li>\n<li>3\u3001\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\uff1a\u53ef\u4ee5\u901a\u8fc7I\/O\u64cd\u4f5c\u8bfb\u53d6\u6587\u4ef6\u7684\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<p>\u5efa\u7acb\u7d22\u5f15\uff1a<\/p>\n<blockquote>\n<p>\u8fd9\u662f\u6700\u5173\u952e\u7684\u6b65\u9aa4\u4e5f\u662f\u6700\u62bd\u8c61\uff0c\u6700\u96be\u7406\u89e3\u7684\uff0c\u91c7\u7528\u573a\u666f1\u8bf4\u660e<\/p>\n<\/blockquote>\n<p>\u521b\u5efa\u7d22\u5f15\u7684\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u83b7\u53d6\u6587\u6863\uff08IO\uff09<\/li>\n<li>\u521b\u5efa\u6587\u6863\u5bf9\u8c61<\/li>\n<li>\u5206\u6790\u6587\u6863\uff08\u62c6\u8bcd\uff09\uff08\u4f7f\u7528\u5206\u8bcd\u5668\uff09\u521b\u5efa\u7d22\u5f15<\/li>\n<li>\u6254\u8fdb\u7d22\u5f15\u5e93<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u66f4\u597d\u7684\u7406\u89e3\u8fd9\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<pre><code>\u9700\u8981\u660e\u767d\u4e00\u4e2a\u95ee\u9898\uff0c\u7d22\u5f15\u5e93\u91cc\u662f\u4ec0\u4e48\u4e1c\u897f\uff1f\n\u770b\u6d41\u7a0b\u56fe\u3002\u7528\u6237\u6839\u636e\u7d22\u5f15\u67e5\u8be2\uff0c\u5f97\u5230\u7684\u662f\u8fd4\u56de\u7684\u7ed3\u679c\u3002\u7c7b\u6bd4\u8bcd\u5178\uff0c\u90a3\u4e48\u7d22\u5f15\u5e93\u5c31\u662f\u4e00\u4e2a\u8bcd\u5178\u3002\n\u4e5f\u5c31\u8bf4\uff0c\u7d22\u5f15\u5e93\u4e2d\uff0c\u65e2\u6709\u7d22\u5f15\uff0c\u5e76\u4e14\u53c8\u6709\u539f\u59cb\u6587\u6863\u3002\n\u5168\u6587\u68c0\u7d22\u7684\u5185\u5bb9\u662f\u7d22\u5f15\u5e93\u4e2d\u7684\u5185\u5bb9\uff0c\u5e76\u6ca1\u6709\u53bb\u539f\u59cb\u6587\u6863\u603b\u627e\u3002\u800c\u8fd9\u4e2a\u5185\u5bb9\u662f\u6211\u4eec\u5728\u5efa\u7acb\u7d22\u5f15\u5e93\u7684\u65f6\u5019\uff0c\u5c06\u5185\u5bb9\u5b8c\u5b8c\u5168\u5168\u7684\u590d\u5236\u5230\u4e86\u7d22\u5f15\u5e93\uff08\u7406\u89e3\u6210\u590d\u5236\uff09<\/code><\/pre>\n<p>\u8bb0\u4f4f\uff1a<\/p>\n<pre><code>\u6254\u8fdb\u7d22\u5f15\u5e93\u7684\u662f\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61\uff01\u8fd9\u4e2a\u6587\u6863\u5bf9\u8c61\u6254\u8fdb\u7d22\u5f15\u5e93\u7684\u65f6\u5019\uff0c\u81ea\u52a8\u521b\u5efa\u4e86\u7d22\u5f15!\n\u6587\u6863\u5bf9\u8c61\u662f\u4ec0\u4e48\uff1f\uff08\u62bd\u8c61\uff09\n\u8fd9\u4e2a\u6587\u6863\u5bf9\u8c61\u5c31\u662f\u6211\u4eec\u6784\u5efa\u7684\uff0c\u4e00\u4e2aworld\u6587\u4ef6\u5c31\u662f\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61\n\u6587\u6863\u5bf9\u8c61\u7531\u57df\u7ec4\u6210(Field)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.appblog.cn\/wp-content\/uploads\/2023\/05\/\u6587\u6863\u5bf9\u8c61.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.appblog.cn\/wp-content\/uploads\/2023\/05\/\u6587\u6863\u5bf9\u8c61\u7684\u57df.png\" alt=\"\" \/><\/p>\n<p>\u57dffield\uff1a\u5c31\u662f\u63cf\u8ff0\u8fd9\u4e2a\u5bf9\u8c61\u7684\u5c5e\u6027\u3002\u597d\u6bd4\u63cf\u8ff0\u5bf9\u8c61\u7684\u5b57\u6bb5\uff08\u4f46\u662f\u5b8c\u5168\u4e0d\u4e00\u6837\uff09\uff0c\u4f8b\u5982\u63cf\u8ff0\u8fd9\u4e2aworld\u7684\u5927\u5c0f\u3001\u5185\u5bb9\u3001\u957f\u5ea6\uff0c\u90fd\u662f\u4e00\u4e2a\u57df\u3002<\/p>\n<ol>\n<li>\u6bcf\u4e2a\u6587\u6863\u5bf9\u8c61\u4e2d\u5305\u62ec\u591a\u4e2aField\uff08\u57df\uff09\uff0c\u57df\u53ea\u6709\u4e24\u4e2a\u5c5e\u6027\uff1a\u57df\u540d\uff08name\uff09\u548c\u57df\u503c\uff08value\uff09\u3002\u4e00\u4e2a\u5bf9\u8c61\u76f8\u5f53\u4e8e\u6570\u636e\u5e93\u8868\u7684\u4e00\u6761\u8bb0\u5f55\uff0c\u4e00\u4e2aField\u76f8\u5f53\u4e8e\u8868\u4e2d\u7684\u4e00\u4e2a\u5b57\u6bb5<\/li>\n<li>\u4e0d\u540c\u7684\u5bf9\u8c61\u53ef\u4ee5\u6709\u4e0d\u540c\u7684Field\uff0c\u540c\u4e00\u4e2a\u5bf9\u8c61\u53ef\u4ee5\u6709\u76f8\u540c\u7684Field\uff08\u57df\u540d\u548c\u57df\u503c\u90fd\u76f8\u540c\uff09\uff08\u8ddf\u6570\u636e\u5e93\u5b57\u6bb5\u5b8c\u5168\u4e0d\u4e00\u6837\uff09<\/li>\n<\/ol>\n<p>\u548c\u6570\u636e\u5e93\u8868\u7c7b\u4f3c\uff0c\u6bcf\u4e2a\u6587\u6863\u90fd\u6709\u4e00\u4e2a\u552f\u4e00\u7684\u4e3b\u952e\u2014\u2014\u6587\u6863id\uff08docID\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e2\u7136Lucene\u662f\u5b9e\u73b0\u5168\u6587\u68c0\u7d22\uff0c\u90a3\u4e48\u660e\u767d\u4ee5\u4e0b\u51e0\u4e2a\u95ee\u9898\uff0c Lucene\u662f\u4ec0\u4e48\uff1f Lucene\u5b9e\u73b0\u5168\u6587\u68c0\u7d22\u7684\u6d41\u7a0b\uff1f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[560],"tags":[559],"class_list":["post-2209","post","type-post","status-publish","format-standard","hentry","category-lucene","tag-lucene"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2209"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2209\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}