diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 65b3254a..3f8fdfd0 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -542,8 +542,10 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements goodsWords.setSort(0); goodsWordsService.save(goodsWords); } - } catch (MyBatisSystemException e) { + } catch (MyBatisSystemException me) { log.error(words + "关键字已存在!"); + } catch (Exception e) { + log.error("关键字入库异常!", e); } } diff --git a/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java b/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java index 4770c933..a4cac7dc 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ElasticsearchController.java @@ -26,6 +26,7 @@ import cn.lili.modules.store.entity.dos.StoreGoodsLabel; import cn.lili.modules.store.service.StoreGoodsLabelService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.bind.annotation.GetMapping; @@ -47,6 +48,7 @@ import java.util.Map; @RestController @Api(tags = "ES初始化接口") @RequestMapping("/manager/elasticsearch") +@Slf4j public class ElasticsearchController { @Autowired @@ -133,6 +135,7 @@ public class ElasticsearchController { } catch (Exception e) { cache.put(CachePrefix.INIT_INDEX_PROCESS.getPrefix(), null); cache.put(CachePrefix.INIT_INDEX_FLAG.getPrefix(), false); + log.error("初始化索引异常", e); } }); return ResultUtil.success();