Authored by 胡古飞

每次重建索引加载一下 屏蔽的SKN信息

... ... @@ -3,6 +3,8 @@ package com.yoho.search.consumer.index.common.impl;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.common.IYohoIndexRebuildListener;
import com.yoho.search.consumer.service.logic.ProductVectorFeatureLogicService;
import com.yoho.search.consumer.service.logic.tools.ForbiddenPageIdsLogicService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,9 +17,10 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
@Autowired
private IndexRebuildListenerMgr indexRebuildListenerMgr;
@Autowired
private ProductVectorFeatureLogicService productVectorFeatureLogicService;
@Autowired
private ForbiddenPageIdsLogicService forbiddenPageIdsLogicService;
@Override
public void afterPropertiesSet() throws Exception {
... ... @@ -26,7 +29,8 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
@Override
public void beforeRebuild() {
productVectorFeatureLogicService.updateGenerateDate();
forbiddenPageIdsLogicService.reloadForbiddenPageIds();
productVectorFeatureLogicService.updateGenerateDate();
}
@Override
... ...
... ... @@ -22,6 +22,8 @@ public class ForbiddenPageIdsLogicService {
private static final Logger logger = LoggerFactory.getLogger(ForbiddenPageIdsLogicService.class);
private final Logger INDEX_REBUILD_LOG = LoggerFactory.getLogger("INDEX_REBULDER");
@Autowired
private BigDataRedisOper<String, String> bigDataRedisOper;
... ... @@ -30,6 +32,7 @@ public class ForbiddenPageIdsLogicService {
private Map<String, List<String>> skn_forbiddenPageIds_map = null;
public synchronized Map<String, List<String>> reloadForbiddenPageIds() {
INDEX_REBUILD_LOG.info("do reloadForbiddenPageIds .........");
List<String> allPageIds = SearchPageIdDefine.getAllPgeIds();
Map<String, List<String>> temp = new HashMap<String, List<String>>();
for (String pageId : allPageIds) {
... ... @@ -52,7 +55,7 @@ public class ForbiddenPageIdsLogicService {
reloadForbiddenPageIds();
}
}
private Set<String> getPageForbiddenSknSet(String pageId) {
try {
String redisKey = String.format(key, pageId);
... ...