Authored by iknitting

处理缓存的数据

... ... @@ -65,28 +65,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
* 通用的查询接口
*
* @param indexName
* @param searchParam
* @return
*/
public SearchResult doSearch(final String indexName, final SearchParam searchParam) {
long begin = System.currentTimeMillis();
performanceMonitor.addVisitCount();
try {
IElasticsearchClient client = elasticsearchClientFactory.getClient(indexName);
SearchResult searchResult = client.search(indexName, indexName, searchParam);
this.publishSearchResultEvent(indexName, searchParam, searchResult);
return searchResult;
} catch (Exception e) {
throw e;
}finally{
performanceMonitor.addCost(System.currentTimeMillis() - begin);
}
}
/**
* 通用的查询接口
*
* @param indexName
* @param
* @return
*/
... ... @@ -141,6 +119,28 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
}
/**
* 通用的查询接口
*
* @param indexName
* @param searchParam
* @return
*/
public SearchResult doSearch(final String indexName, final SearchParam searchParam) {
long begin = System.currentTimeMillis();
performanceMonitor.addVisitCount();
try {
IElasticsearchClient client = elasticsearchClientFactory.getClient(indexName);
SearchResult searchResult = client.search(indexName, indexName, searchParam);
this.publishSearchResultEvent(indexName, searchParam, searchResult);
return searchResult;
} catch (Exception e) {
throw e;
}finally{
performanceMonitor.addCost(System.currentTimeMillis() - begin);
}
}
/**
* 通过id获取内容
*
* @param indexName
... ...
... ... @@ -236,7 +236,9 @@ public class CsSearchResourceService {
String default_images = MapUtils.getString(product, "default_images", "");
default_images = getDefaultImages(cover_1, cover_2, default_images, productGender);
default_images = ImageUrlAssist.getAllProductPicUrl(default_images, "goodsimg", "center", "d2hpdGU=");
if(null==resource.get("bgImage")){ // 缓存中可能已经有了
resource.put("bgImage", resource.get("image"));
}
resource.replace("image", default_images);
resource.put("firstProductSkn", productSkn);
resource.put("bgName", "主题精选");
... ...