...
|
...
|
@@ -12,7 +12,6 @@ import com.yoho.search.service.helper.ProductListHelper; |
|
|
import com.yoho.search.service.index.BigdataSimilarSknIndexBaseService;
|
|
|
import com.yoho.search.service.index.ProductIndexBaseService;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilder;
|
...
|
...
|
@@ -44,8 +43,17 @@ public class SearchLikeNotInShopService { |
|
|
@Autowired
|
|
|
private BigdataSimilarSknIndexBaseService bigdataSimilarSknIndexBaseService;
|
|
|
|
|
|
@SearchCacheAble(cacheInMinute = 600, cacheName = "SEARCH_LIKE_NOT_IN_SHOP_SIMILAR_NEW", includeParams = {"product_skn", "use_yoho_image"})
|
|
|
@SearchCacheAble(cacheInMinute = 600, cacheName = "SEARCH_LIKE_NOT_IN_SHOP_SIMILAR_NEW", includeParams = {"product_skn"})
|
|
|
public SearchApiResult searchLikeSimilarSknNotInShop(Map<String, String> paramMap) {
|
|
|
return innersearchLikeSimilarSknNotInShop(paramMap, false);
|
|
|
}
|
|
|
|
|
|
@SearchCacheAble(cacheInMinute = 600, cacheName = "SEARCH_LIKE_NOT_IN_SHOP_SIMILAR_NEW_B", includeParams = {"product_skn"})
|
|
|
public SearchApiResult searchLikeSimilarSknNotInShopWithYohoImage(Map<String, String> paramMap) {
|
|
|
return innersearchLikeSimilarSknNotInShop(paramMap, true);
|
|
|
}
|
|
|
|
|
|
private SearchApiResult innersearchLikeSimilarSknNotInShop(Map<String, String> paramMap, boolean use_yoho_image) {
|
|
|
try {
|
|
|
// 1、获取参数
|
|
|
String productSkn = paramMap.get(SearchRequestParams.PARAM_SEARCH_PRODUCT_SKN);
|
...
|
...
|
@@ -62,7 +70,6 @@ public class SearchLikeNotInShopService { |
|
|
|
|
|
//4、获取similarskn
|
|
|
BigdataSimilarSknIndexBO bigdataSimilarSkn = bigdataSimilarSknIndexBaseService.querySimilarSkn(productSkn);
|
|
|
boolean use_yoho_image = MapUtils.getBooleanValue(paramMap, "use_yoho_image", false);
|
|
|
|
|
|
//5、构造searchParams
|
|
|
List<SearchParam> searchParams = new ArrayList<>();
|
...
|
...
|
@@ -135,7 +142,7 @@ public class SearchLikeNotInShopService { |
|
|
* @param productSkns
|
|
|
* @return
|
|
|
*/
|
|
|
private SearchParam builderSimilarSknSearchParam(JSONObject productInfoInEs, List<String> productSkns){
|
|
|
private SearchParam builderSimilarSknSearchParam(JSONObject productInfoInEs, List<String> productSkns) {
|
|
|
// 1、设置SearchParam
|
|
|
SearchParam searchParam = new SearchParam();
|
|
|
// 2)设置query和filter
|
...
|
...
|
|