Authored by Gino Zhang

paramterMake处理的时候注意斜杠

... ... @@ -27,7 +27,7 @@ public class SuggestConvertorService {
private static final int MAX_KEYWORDS = 5;
// TODO:
private static final List<String> IGNORE_KEYWORDS = Arrays.asList("其他");
private static final List<String> IGNORE_KEYWORDS = Arrays.asList("其他","正常");
@Autowired
private AnalyzerHelper analyzerHelper;
... ... @@ -48,12 +48,10 @@ public class SuggestConvertorService {
private SpiderContentService spiderContentService;
public Map<String, Set<String>> getAllYohoKeywords() {
// 使用List是希望能保持按【sort -> style -> maker -> brand】顺序优先处理
// List<String> keywordList = new ArrayList<>();
Set<String> keywordSet = new HashSet<>(3000);
keywordSet.addAll(getSortNameSet());
keywordSet.addAll(getStyleNameSet());
keywordSet.addAll(getParameterMakeNameSet());
keywordSet.addAll(getParameterMakeValueSet());
keywordSet.addAll(getBrandNameSet());
logger.info("[func=getAllYohoKeywords][keywordSetSize={}]", keywordSet.size());
... ... @@ -87,9 +85,17 @@ public class SuggestConvertorService {
return styleList.stream().map(Style::getStyleName).filter(name -> StringUtils.isNotBlank(name)).collect(Collectors.toSet());
}
private Set<String> getParameterMakeNameSet() {
private Set<String> getParameterMakeValueSet() {
Set<String> parameterValueSet = new HashSet<>(1000);
List<ParameterMake> parameterMakeList = parameterMakeService.getAll();
return parameterMakeList.stream().map(ParameterMake::getParameterValue).filter(name -> StringUtils.isNotBlank(name)).collect(Collectors.toSet());
parameterMakeList.forEach(paramterMake -> {
if(StringUtils.isNotEmpty(paramterMake.getParameterValue()) && paramterMake.getParameterValue().length() > 1){
for(String item : paramterMake.getParameterValue().split("\\/")){
parameterValueSet.add(item);
}
}
});
return parameterValueSet;
}
private Set<String> getBrandNameSet() {
... ...