如果价格带向量为空,则向量计算出的品类品牌设为空
Showing
2 changed files
with
6 additions
and
0 deletions
@@ -17,6 +17,9 @@ public class SortBrandVectorComponent { | @@ -17,6 +17,9 @@ public class SortBrandVectorComponent { | ||
17 | private SortBrandVectorCacheBean sortBrandVectorCacheBean; | 17 | private SortBrandVectorCacheBean sortBrandVectorCacheBean; |
18 | 18 | ||
19 | public List<SortBrand> queryVectorSortBrandList(List<SortBrand> pageSortBrands,Set<String> filterKeys, List<Double> userVectorList, int count){ | 19 | public List<SortBrand> queryVectorSortBrandList(List<SortBrand> pageSortBrands,Set<String> filterKeys, List<Double> userVectorList, int count){ |
20 | + if(userVectorList==null || userVectorList.isEmpty()){ | ||
21 | + return new ArrayList<>(); | ||
22 | + } | ||
20 | List<SortBrandVectorScore> sortBrandVectorScores = new ArrayList<>(); | 23 | List<SortBrandVectorScore> sortBrandVectorScores = new ArrayList<>(); |
21 | for (SortBrand sortBrand:pageSortBrands) { | 24 | for (SortBrand sortBrand:pageSortBrands) { |
22 | if(filterKeys.contains(sortBrand.key())){ | 25 | if(filterKeys.contains(sortBrand.key())){ |
service/src/main/java/com/yoho/search/recall/scene/beans/persional/UserPersionalFactorComponent.java
@@ -47,6 +47,9 @@ public class UserPersionalFactorComponent { | @@ -47,6 +47,9 @@ public class UserPersionalFactorComponent { | ||
47 | if(rsp.getSortPriceAreasList()==null){ | 47 | if(rsp.getSortPriceAreasList()==null){ |
48 | rsp.setSortPriceAreasList(new ArrayList<>()); | 48 | rsp.setSortPriceAreasList(new ArrayList<>()); |
49 | } | 49 | } |
50 | + if(rsp.getSortBrandVector()==null){ | ||
51 | + rsp.setSortBrandVector(new ArrayList<>()); | ||
52 | + } | ||
50 | return rsp; | 53 | return rsp; |
51 | } catch (Exception e) { | 54 | } catch (Exception e) { |
52 | RECALL_NEW_LOGGER.error(e.getMessage(), e); | 55 | RECALL_NEW_LOGGER.error(e.getMessage(), e); |
-
Please register or login to post a comment