Authored by hugufei

fix 最近浏览skn的bug

@@ -54,8 +54,6 @@ public class SknRecallCacheBean { @@ -54,8 +54,6 @@ public class SknRecallCacheBean {
54 try { 54 try {
55 if (recommedSknList == null || recommedSknList.isEmpty()) { 55 if (recommedSknList == null || recommedSknList.isEmpty()) {
56 return new ArrayList<>(); 56 return new ArrayList<>();
57 - //localhost:8080/yohosearch/productindex/productList.json?uid=11145&status=1&gender=1,2,3,4,5  
58 - //recommedSknList = Arrays.asList(50020667, 50026235);  
59 } 57 }
60 List<Integer> filterSknList; 58 List<Integer> filterSknList;
61 if (recallWithCache) { 59 if (recallWithCache) {
@@ -95,20 +93,18 @@ public class SknRecallCacheBean { @@ -95,20 +93,18 @@ public class SknRecallCacheBean {
95 RECALL_NEW_LOGGER.info("filterSknBy EhCache success"); 93 RECALL_NEW_LOGGER.info("filterSknBy EhCache success");
96 return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, ehcacheQueryResult); 94 return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, ehcacheQueryResult);
97 } 95 }
98 -  
99 -// //3、再从redis的bitset缓存结构中过滤  
100 -// Map<Integer, Boolean> redisQueryResult = searchRedis.getFromBitSet(redisKeyBuilder, recommedProductIds);  
101 -// if (redisQueryResult != null) {  
102 -// RECALL_NEW_LOGGER.info("filterSknBy Redis success");  
103 -// return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, redisQueryResult);  
104 -// } 96 + //3、再从redis的bitset缓存结构中过滤
  97 + Map<Integer, Boolean> redisQueryResult = searchRedis.getFromBitSet(redisKeyBuilder, recommedProductIds);
  98 + if (redisQueryResult != null) {
  99 + RECALL_NEW_LOGGER.info("filterSknBy Redis success");
  100 + return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, redisQueryResult);
  101 + }
105 //4、执行查询,添加到缓存 102 //4、执行查询,添加到缓存
106 PageProductIdBitSet pageProductIdBitSet = pageProductIdBitSetComponent.queryPageProductIdBitSet(userRecallRequest.getParamQueryFilter()); 103 PageProductIdBitSet pageProductIdBitSet = pageProductIdBitSetComponent.queryPageProductIdBitSet(userRecallRequest.getParamQueryFilter());
107 -  
108 //4.1)添加到本地缓存 104 //4.1)添加到本地缓存
109 this.ehCache.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute()); 105 this.ehCache.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute());
110 -// //4.2)异步添加到redis缓存  
111 -// this.searchRedis.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute()); 106 + //4.2)异步添加到redis缓存
  107 + this.searchRedis.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute());
112 return this.filterSknByPageProductIdBitSet(recommedSknList, productSknToIdMap, pageProductIdBitSet.getProductIdBitSet()); 108 return this.filterSknByPageProductIdBitSet(recommedSknList, productSknToIdMap, pageProductIdBitSet.getProductIdBitSet());
113 } 109 }
114 110
@@ -59,7 +59,8 @@ public class PageProductIdBitSetComponent extends AbstractPageComponent<PageProd @@ -59,7 +59,8 @@ public class PageProductIdBitSetComponent extends AbstractPageComponent<PageProd
59 59
60 BoolQueryBuilder filter = QueryBuilders.boolQuery(); 60 BoolQueryBuilder filter = QueryBuilders.boolQuery();
61 filter.must(paramQueryFilter.getParamFilter()); 61 filter.must(paramQueryFilter.getParamFilter());
62 - filter.mustNot(ExtendFilterHelper.notRecallFilter());//聚合的时候带上不召回的数据 62 + //filter.mustNot(QueryBuilders.termQuery(ProductIndexEsField.isGlobal, "Y"));
  63 + //filter.mustNot(QueryBuilders.rangeQuery(ProductIndexEsField.breakSizePercent).gt(50));
63 searchParam.setFiter(filter); 64 searchParam.setFiter(filter);
64 65
65 searchParam.setSize(0); 66 searchParam.setSize(0);