{"id":2219,"date":"2023-05-03T20:58:26","date_gmt":"2023-05-03T12:58:26","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=2219"},"modified":"2023-05-04T05:42:04","modified_gmt":"2023-05-03T21:42:04","slug":"springboot-lucene-chapter-5-create-indexes-fields","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/05\/03\/springboot-lucene-chapter-5-create-indexes-fields\/","title":{"rendered":"SpringBoot+Lucene\u7b2c\u4e94\u7bc7 \u2014 \u521b\u5efa\u7d22\u5f15 \u2014 \u57df\u7684\u518d\u5b66\u4e60"},"content":{"rendered":"<p>\u524d\u6587\u5b9e\u73b0\u4e86\u4e00\u4e2alucenne\u7684\u5168\u6587\u68c0\u7d22\uff0c\u56de\u987e\u4e00\u4e0b\u6211\u4eec\u7684\u6d41\u7a0b\uff1a<\/p>\n<ul>\n<li>\u9488\u5bf9\u6bcf\u4e2a\u6587\u6863\uff0c\u6784\u5efa\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61\u3002\u8be5\u6587\u6863\u5bf9\u8c61\u91cc\u9762\u7528\u4e86\u4e0d\u540c\u7684\u57df\uff0c\u63cf\u8ff0\u4e86\u8be5\u6587\u6863\u7684\u4fe1\u606f\uff0c\u5927\u5c0f\uff0c\u5185\u5bb9\u3002\u3002\u3002<\/li>\n<li>\u5c06\u6587\u6863\u5bf9\u8c61\u6254\u8fdb\u7d22\u5f15\u5e93<\/li>\n<li>\u5c06\u7d22\u5f15\u5e93\uff0c\u5b58\u653e\u5728\u672c\u5730\u78c1\u76d8<\/li>\n<li>\u5230\u78c1\u76d8\u7684\u7d22\u5f15\u5e93\u76ee\u5f55\u4e0b\uff0c\u521b\u5efa\u4e86\u4e00\u4e2a\u67e5\u8be2\u5bf9\u8c61\uff0c\u67e5\u8be2\u6761\u4ef6\u662f\uff1a\u6307\u5b9a\u5185\u5bb9\u5206\u8bcd\u8fdb\u884c\u67e5\u8be2\uff0c\u83b7\u53d6\u67e5\u8be2\u7ed3\u679c<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u5bf9\u7b2c\u4e00\u6bb5\u4ee3\u7801\u8fdb\u884c\u7ee7\u7eed\u4ecb\u7ecd\uff1a\u7b2c\u4e00\u6bb5\u4ee3\u7801\u5728\u6784\u5efa\u57df\u7684\u65f6\u5019\uff0c\u4e0d\u540c\u7684\u57df<code>new Filed<\/code>\u7684\u5b50\u7c7b\u4e0d\u4e00\u6837<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.appblog.cn\/wp-content\/uploads\/2023\/05\/SpringBootLucene\u521b\u5efa\u7d22\u5f15\u4e4b\u8bbe\u7f6e\u57df.png\" alt=\"\" \/><\/p>\n<p>\uff081\uff09\u662f\u5426\u5206\u8bcd<\/p>\n<ul>\n<li>\u662f\uff1a\u5bf9\u8be5field\u5b58\u50a8\u7684\u5185\u5bb9\u8fdb\u884c\u5206\u8bcd\uff0c\u5206\u8bcd\u7684\u76ee\u7684\uff0c\u5c31\u662f\u4e3a\u4e86\u7d22\u5f15\u3002\u6bd4\u5982\uff1a\u6587\u6863\u7684\u5185\u5bb9<\/li>\n<li>\u5426\uff1a\u4e0d\u9700\u8981\u5bf9field\u5b58\u50a8\u7684\u5185\u5bb9\u8fdb\u884c\u5206\u8bcd\uff0c\u4e0d\u5206\u8bcd\uff0c\u4e0d\u4ee3\u8868\u4e0d\u7d22\u5f15\uff0c\u800c\u662f\u5c06\u6574\u4e2a\u5185\u5bb9\u8fdb\u884c\u7d22\u5f15\u3002\u6bd4\u5982\uff1a\u6587\u4ef6\u5927\u5c0f\uff0c\u6587\u4ef6\u8def\u5f84\uff0c\u4e0d\u9700\u8981\u5206\u8bcd<\/li>\n<\/ul>\n<p>\uff082\uff09\u662f\u5426\u7d22\u5f15<\/p>\n<ul>\n<li>\u662f\uff1a\u5c06\u5206\u597d\u7684\u8bcd\u8fdb\u884c\u7d22\u5f15\uff0c\u7d22\u5f15\u7684\u76ee\u7684\uff0c\u5c31\u662f\u4e3a\u4e86\u641c\u7d22<\/li>\n<li>\u5426\uff1a\u4e0d\u7d22\u5f15\uff0c\u4e5f\u5c31\u662f\u4e0d\u5bf9\u8be5field\u57df\u8fdb\u884c\u641c\u7d22<\/li>\n<li>\u662f\u5426\uff1a\u5c31\u662f\u6307\u5b9a\u6254\u8fdb\u7d22\u5f15\u5e93\u7684\u65f6\u5019\uff0c\u5bf9\u4e0d\u5bf9\u5206\u7684\u8bcd\u521b\u5efa\u7d22\u5f15<\/li>\n<\/ul>\n<p>\uff083\uff09\u662f\u5426\u5b58\u50a8<\/p>\n<ul>\n<li>\u662f\uff1a\u5c06field\u57df\u4e2d\u7684\u5185\u5bb9\u5b58\u50a8\u5230\u6587\u6863\u57df\u4e2d\u3002\u5b58\u50a8\u7684\u76ee\u7684\uff0c\u5c31\u662f\u4e3a\u4e86\u641c\u7d22\u9875\u9762\u663e\u793a\u53d6\u503c\u7528\u7684<\/li>\n<li>\u5426\uff1a\u4e0d\u5c06field\u57df\u4e2d\u7684\u5185\u5bb9\u5b58\u50a8\u5230\u6587\u6863\u57df\u4e2d\u3002\u4e0d\u5b58\u50a8\uff0c\u5219\u641c\u7d22\u9875\u9762\u4e2d\u6ca1\u6cd5\u83b7\u53d6\u8be5field\u57df\u7684\u503c<\/li>\n<\/ul>\n<p>\u6bd4\u5982\uff1a<code>Field fileContentField = new TextField(&quot;fileContent&quot;, file_content, Store.NO);<\/code> \u6587\u4ef6\u7684\u5185\u5bb9\u6ca1\u6709\u8fdb\u884c\u50a8\u5b58\uff0c\u4e0d\u80fd\u83b7\u53d6\u5230<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6587\u5b9e\u73b0\u4e86\u4e00\u4e2alucenne\u7684\u5168\u6587\u68c0\u7d22\uff0c\u56de\u987e\u4e00\u4e0b\u6211\u4eec\u7684\u6d41\u7a0b\uff1a \u9488\u5bf9\u6bcf\u4e2a\u6587\u6863\uff0c\u6784\u5efa\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61\u3002\u8be5\u6587\u6863\u5bf9\u8c61\u91cc\u9762\u7528 [&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-2219","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\/2219","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=2219"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2219\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}