...
|
...
|
@@ -110,10 +110,10 @@ public class SearchCommonService { |
|
|
return result;
|
|
|
}
|
|
|
// 1、先从缓存中取结果
|
|
|
// List<Map<String, Object>> resultFromCache = cacheService.getMultiGetResultFromCache(indexName, idList, fields);
|
|
|
// if (resultFromCache != null) {
|
|
|
// return resultFromCache;
|
|
|
// }
|
|
|
List<Map<String, Object>> resultFromCache = cacheService.getMultiGetResultFromCache(indexName, idList, fields);
|
|
|
if (resultFromCache != null) {
|
|
|
return resultFromCache;
|
|
|
}
|
|
|
// 2、先ES中批量获取结果
|
|
|
Index firstIndex = indexService.getIndex(indexName);
|
|
|
if (firstIndex != null) {
|
...
|
...
|
@@ -125,9 +125,9 @@ public class SearchCommonService { |
|
|
}, firstIndex);
|
|
|
}
|
|
|
// 3、将搜索结果加入到缓存中
|
|
|
// if (result != null) {
|
|
|
// cacheService.addMultiGetResultResultToCache(indexName, idList,fields, result);
|
|
|
// }
|
|
|
if (result != null) {
|
|
|
cacheService.addMultiGetResultResultToCache(indexName, idList,fields, result);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
|