|
|
package com.yoho.search.consumer.suggests.discover;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.yoho.search.consumer.service.base.BrandService;
|
|
|
import com.yoho.search.consumer.service.base.ProductService;
|
|
|
import com.yoho.search.consumer.service.base.ProductSortService;
|
|
|
import com.yoho.search.consumer.suggests.common.KeywordType;
|
|
|
import com.yoho.search.consumer.suggests.common.SuggestSplitUtils;
|
|
|
import com.yoho.search.consumer.suggests.common.SuggestionConstants;
|
|
|
import com.yoho.search.dal.model.Brand;
|
|
|
import com.yoho.search.dal.model.Product;
|
|
|
import com.yoho.search.dal.model.ProductSort;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
@Component
|
|
|
public class ProductNameSuggestionDiscoverer extends AbstractSuggestionDiscoverer {
|
...
|
...
|
@@ -38,7 +34,9 @@ public class ProductNameSuggestionDiscoverer extends AbstractSuggestionDiscovere |
|
|
super.init();
|
|
|
List<Brand> brands = brandService.getBrandPageLists(0, Integer.MAX_VALUE);
|
|
|
for (Brand brand : brands) {
|
|
|
brandMap.put(brand.getId(), brand);
|
|
|
if(!SuggestionConstants.IGNORE_BRAND_NAMES.contains(brand.getBrandName())){
|
|
|
brandMap.put(brand.getId(), brand);
|
|
|
}
|
|
|
}
|
|
|
List<ProductSort> productSorts = productSortService.getPageLists(0, Integer.MAX_VALUE);
|
|
|
for (ProductSort productSort : productSorts) {
|
...
|
...
|
|