From 59171fdb9b656986dbc6c16fbd1bec42d858b346 Mon Sep 17 00:00:00 2001 From: suwen <577014284@qq.com> Date: Thu, 4 Feb 2021 17:36:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20lucene=E7=B4=A2=E5=BC=95=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=87=AA=E5=8A=A8=E5=BB=BA=E7=AB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../forest/lucene/api/LuceneSearchController.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/rymcu/forest/lucene/api/LuceneSearchController.java b/src/main/java/com/rymcu/forest/lucene/api/LuceneSearchController.java index 656b7b6..3afa553 100755 --- a/src/main/java/com/rymcu/forest/lucene/api/LuceneSearchController.java +++ b/src/main/java/com/rymcu/forest/lucene/api/LuceneSearchController.java @@ -8,9 +8,9 @@ import com.rymcu.forest.dto.ArticleDTO; import com.rymcu.forest.lucene.model.ArticleLucene; import com.rymcu.forest.lucene.service.LuceneService; import com.rymcu.forest.util.Utils; -import lombok.extern.log4j.Log4j2; import org.springframework.web.bind.annotation.*; +import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.List; @@ -26,11 +26,9 @@ public class LuceneSearchController { @Resource private LuceneService luceneService; - @GetMapping("/createIndex") - public GlobalResult createIndex( - @RequestParam(required = false, defaultValue = "0") Integer limit, - @RequestParam(required = false, defaultValue = "1000") Integer offset) { - // 拉取数据 + @PostConstruct + public GlobalResult createIndex() { + System.out.println(">>>>>>>>>init index<<<<<<<<<<<"); luceneService.writeArticle(luceneService.getAllArticleLucene()); return GlobalResultGenerator.genSuccessResult("创建索引成功"); }