...
|
...
|
@@ -55,9 +55,6 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest |
|
|
|
|
|
@Autowired
|
|
|
private SearchCommonService searchCommonService;
|
|
|
|
|
|
@Autowired
|
|
|
private SearchCacheService searchCacheService;
|
|
|
@Autowired
|
|
|
private SearchCacheFactory searchCacheFactory;
|
|
|
private SearchCache searchCache;
|
...
|
...
|
@@ -130,14 +127,7 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest |
|
|
sortBuilders.add(SortBuilders.fieldSort("questionSeq").order(SortOrder.DESC));
|
|
|
searchParam.setSortBuilders(sortBuilders);
|
|
|
|
|
|
// 6.走本地缓存
|
|
|
final String indexName = ISearchConstants.INDEX_NAME_ROBOTQUESTION;
|
|
|
JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(searchCache, indexName, searchParam);
|
|
|
if (cacheObject != null) {
|
|
|
SearchCacheMatchLogger.doSearchCacheMatchLog("/robotquestion.json", paramMap);
|
|
|
return new SearchApiResult().setData(cacheObject);
|
|
|
}
|
|
|
|
|
|
// 7.查询ES
|
|
|
SearchResult searchResult = searchCommonService.doSearch(indexName, searchParam);
|
|
|
SearchApiResult searchApiResult = new SearchApiResult();
|
...
|
...
|
@@ -151,7 +141,6 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest |
|
|
dataMap.put("page_size", searchParam.getSize());
|
|
|
dataMap.put("page_total", searchResult.getTotalPage());
|
|
|
dataMap.put("answer_list", this.getRobotQuestionMap(searchResult.getResultList()));
|
|
|
searchCacheService.addJSONObjectToCache(searchCache, indexName, searchParam, dataMap);
|
|
|
return new SearchApiResult().setData(dataMap);
|
|
|
} catch (Exception e) {
|
|
|
publisher.publishEvent(new SearchEvent(EventReportEnum.SEARCHCONTROLLER_ROBOTQUESTION.getEventName(), EventReportEnum.SEARCHCONTROLLER_ROBOTQUESTION.getFunctionName(),
|
...
|
...
|
|