...
|
...
|
@@ -47,7 +47,7 @@ import com.yoho.search.core.es.model.SearchParam; |
|
|
import com.yoho.search.core.es.model.SearchResult;
|
|
|
import com.yoho.search.core.es.utils.IgnoreSomeException;
|
|
|
import com.yoho.search.service.aggregations.impls.AggregationFactoryService;
|
|
|
import com.yoho.search.service.cache.CatchMatchLogger;
|
|
|
import com.yoho.search.service.cache.SearchCacheMatchLogger;
|
|
|
import com.yoho.search.service.cache.SearchCacheFactory;
|
|
|
import com.yoho.search.service.cache.model.SearchCache;
|
|
|
import com.yoho.search.service.service.AggregationService;
|
...
|
...
|
@@ -127,7 +127,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
final String indexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX;
|
|
|
JSONArray cacheJSONArray = searchCacheService.getJSONArrayFromCache(brandAndShopSearchCache, indexName, searchParam);
|
|
|
if (cacheJSONArray != null) {
|
|
|
CatchMatchLogger.doCatchMatchLog("/productindex/aggBrand.json", paramMap);
|
|
|
SearchCacheMatchLogger.doCatchMatchLog("/productindex/aggBrand.json", paramMap);
|
|
|
return new SearchApiResult().setData(cacheJSONArray);
|
|
|
}
|
|
|
// 4、从ES中获取
|
...
|
...
|
@@ -164,7 +164,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
final String indexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX;
|
|
|
JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(brandAndShopSearchCache, indexName, searchParam);
|
|
|
if (cacheObject != null) {
|
|
|
CatchMatchLogger.doCatchMatchLog("/productindex/brands.json", paramMap);
|
|
|
SearchCacheMatchLogger.doCatchMatchLog("/productindex/brands.json", paramMap);
|
|
|
return new SearchApiResult().setData(cacheObject);
|
|
|
}
|
|
|
// 4、查询ES
|
...
|
...
|
@@ -248,7 +248,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
final String brandIndexName = ISearchConstants.INDEX_NAME_BRAND;
|
|
|
JSONArray cacheJSONArray = searchCacheService.getJSONArrayFromCache(brandAndShopSearchCache, brandIndexName, searchParam);
|
|
|
if (cacheJSONArray != null) {
|
|
|
CatchMatchLogger.doCatchMatchLog("/brand/list.json", paramMap);
|
|
|
SearchCacheMatchLogger.doCatchMatchLog("/brand/list.json", paramMap);
|
|
|
return new SearchApiResult().setData(cacheJSONArray);
|
|
|
}
|
|
|
// 3、执行搜索
|
...
|
...
|
@@ -299,7 +299,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
final String productIndexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX;
|
|
|
JSONObject groupBrandResult = searchCacheService.getJSONObjectFromCache(brandAndShopSearchCache, productIndexName, searchParam);
|
|
|
if (groupBrandResult != null) {
|
|
|
CatchMatchLogger.doCatchMatchLog("/productindex/groupBrands.json", paramMap);
|
|
|
SearchCacheMatchLogger.doCatchMatchLog("/productindex/groupBrands.json", paramMap);
|
|
|
return new SearchApiResult().setData(groupBrandResult);
|
|
|
}
|
|
|
// 6、从ES中获取
|
...
|
...
|
@@ -367,7 +367,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
// 6、先从缓存中获取,如果能取到,则直接返回
|
|
|
JSONArray jsonArray = searchCacheService.getJSONArrayFromCache(brandAndShopSearchCache, ISearchConstants.INDEX_NAME_PRODUCT_INDEX, searchParam);
|
|
|
if (jsonArray != null) {
|
|
|
CatchMatchLogger.doCatchMatchLog("/new-shelve.json", paramMap);
|
|
|
SearchCacheMatchLogger.doCatchMatchLog("/new-shelve.json", paramMap);
|
|
|
return searchApiResult.setData(jsonArray);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -460,7 +460,7 @@ public class BrandServiceImpl implements IBrandService, ApplicationEventPublishe |
|
|
// 7、先从缓存中获取,如果能取到,则直接返回
|
|
|
JSONArray jsonArray = searchCacheService.getJSONArrayFromCache(brandAndShopSearchCache, ISearchConstants.INDEX_NAME_PRODUCT_INDEX, searchParam);
|
|
|
if (jsonArray != null) {
|
|
|
CatchMatchLogger.doCatchMatchLog("/new_product.json", paramMap);
|
|
|
SearchCacheMatchLogger.doCatchMatchLog("/new_product.json", paramMap);
|
|
|
return searchApiResult.setData(jsonArray);
|
|
|
}
|
|
|
|
...
|
...
|
|