_historySearchCache = new EHCachingSearchCache(name + "ConfigHistory", cacheManager, new EHCachingSearchCache.Searcher() {
@SuppressWarnings("unchecked")
@Override
public ObjectsPair<Integer, List<UniqueId>> search(Bean request, PagingRequest pagingRequest) {
// Fetch search results from underlying master
ConfigHistoryResult result = ((ConfigMaster) getUnderlying()).history((ConfigHistoryRequest)
EHCachingSearchCache.withPagingRequest((ConfigHistoryRequest) request, pagingRequest));
// Cache the result documents
EHCachingSearchCache.cacheDocuments(result.getDocuments(), getUidToDocumentCache());
// Return the list of result UniqueIds
return new ObjectsPair<>(result.getPaging().getTotalItems(),
EHCachingSearchCache.extractUniqueIds(result.getDocuments()));
}
});
// Prime search cache
ConfigSearchRequest defaultSearch = new ConfigSearchRequest();