Authored by wangnan

【图片搜索】 fix

... ... @@ -124,14 +124,12 @@ public class SknImageVectorsServiceImpl implements ISknImageVectorsService, Appl
//插入查询参数
searchParam.setQuery(functionScoreQueryBuilder);
// 3.走本地缓存
//3.根据特征,查询SknImageVectors索引
final String indexName = ISearchConstants.INDEX_NAME_IMAGE_VECTORS;
//4.根据特征,查询SknImageVectors索引
SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam);
JSONObject dataMap = new JSONObject();
dataMap.put("SearchResult", searchResult);
searchCacheService.addJSONObjectToCache(searchCache, indexName, searchParam, dataMap);
//JSONObject dataMap = new JSONObject();
//dataMap.put("SearchResult", searchResult);
//searchCacheService.addJSONObjectToCache(searchCache, indexName, searchParam, dataMap);
SearchApiResult searchApiResult = new SearchApiResult();
if (CollectionUtils.isNotEmpty(searchResult.getResultList())) {
List<Map<String, Object>> sknList = getSknImageMap(searchResult.getResultList());
... ... @@ -188,7 +186,7 @@ public class SknImageVectorsServiceImpl implements ISknImageVectorsService, Appl
dataMap.put("product_list", productIndexBaseService.getProductListWithPricePlan(searchResult.getResultList(), Arrays.asList("phrase")));
photoListData.put("photoListData",dataMap);
// 5.将结果存进缓存
searchCacheService.addJSONObjectToCache(searchCache, indexName, searchParam, dataMap);
searchCacheService.addJSONObjectToCache(searchCache, indexName, searchParam, photoListData);
return new SearchApiResult().setData(photoListData);
}
... ...