...
|
...
|
@@ -25,6 +25,7 @@ import com.yoho.search.service.service.SearchCommonService; |
|
|
import com.yoho.search.service.service.helper.AggProductListHelper;
|
|
|
import com.yoho.search.service.service.helper.FunctionScoreSearchHelper;
|
|
|
import com.yoho.search.service.service.helper.SearchCommonHelper;
|
|
|
import com.yoho.search.service.service.helper.SearchLikeHelper;
|
|
|
import com.yoho.search.service.service.helper.SearchServiceHelper;
|
|
|
import com.yoho.search.service.service.helper.SearchSortHelper;
|
|
|
import com.yoho.search.service.servicenew.ISearchLikeInShopService;
|
...
|
...
|
@@ -49,7 +50,7 @@ public class SearchLikeInShopServiceImpl implements ISearchLikeInShopService { |
|
|
@Autowired
|
|
|
private AggProductListHelper aggProductListHelper;
|
|
|
@Autowired
|
|
|
private SearchLikeCommonService searchLikeCommonService;
|
|
|
private SearchLikeHelper searchLikeHelper;
|
|
|
|
|
|
public boolean isLegalInteger(Integer id) {
|
|
|
if (id != null && id > 0) {
|
...
|
...
|
@@ -66,7 +67,7 @@ public class SearchLikeInShopServiceImpl implements ISearchLikeInShopService { |
|
|
return new SearchApiResult().setCode(400).setMessage("请输入SKN");
|
|
|
}
|
|
|
// 2、获取当前查询的SKN的基本信息
|
|
|
JSONObject productInfoInEs = searchLikeCommonService.getProductInfoInEs(productSkn);
|
|
|
JSONObject productInfoInEs = searchLikeHelper.getProductInfoInEs(productSkn);
|
|
|
if (productInfoInEs == null) {
|
|
|
return new SearchApiResult().setCode(400).setMessage("SKN不存在");
|
|
|
}
|
...
|
...
|
@@ -90,11 +91,11 @@ public class SearchLikeInShopServiceImpl implements ISearchLikeInShopService { |
|
|
String brandName = productInfoInEs.getString("brandName");
|
|
|
String productFeatureFactor = productInfoInEs.getString("productFeatureFactor");
|
|
|
String query = brandName + "," + productName + "," + standardOnlyNames + "," + style;
|
|
|
QueryBuilder queryBuilder = searchLikeCommonService.genSearchLikeQueryBuilder(query, "40%", productFeatureFactor);
|
|
|
QueryBuilder queryBuilder = searchLikeHelper.genSearchLikeQueryBuilder(query, "40%", productFeatureFactor);
|
|
|
searchParam.setQuery(queryBuilder);
|
|
|
|
|
|
|
|
|
// 5、设置filter
|
|
|
BoolQueryBuilder boolFilter = searchLikeCommonService.genDefaultQueryBuilder(Arrays.asList(productSkn));
|
|
|
BoolQueryBuilder boolFilter = searchLikeHelper.genDefaultQueryBuilder(Arrays.asList(productSkn));
|
|
|
Integer brandId = productInfoInEs.getInteger("brandId");
|
|
|
Integer shopId = productInfoInEs.getInteger("shopId");
|
|
|
if (isLegalInteger(shopId)) {
|
...
|
...
|
@@ -131,7 +132,7 @@ public class SearchLikeInShopServiceImpl implements ISearchLikeInShopService { |
|
|
jsonObject.put("page_total", 1);
|
|
|
jsonObject.put("page_size", pageSize);
|
|
|
jsonObject.put("total", productList.size());
|
|
|
jsonObject.put("product_info", searchLikeCommonService.genProductInfoResult(productInfoInEs));
|
|
|
jsonObject.put("product_info", searchLikeHelper.genProductInfoResult(productInfoInEs));
|
|
|
jsonObject.put("product_list", productList);
|
|
|
searchCacheService.addJSONObjectToCache(cacheEnum, productIndexName, searchParam, jsonObject);
|
|
|
return new SearchApiResult().setData(jsonObject);
|
...
|
...
|
|