// Create the history search cache and register a security master searcher
_historySearchCache = new EHCachingSearchCache(name + "PositionHistory", cacheManager, new EHCachingSearchCache.Searcher() {
@Override
public ObjectsPair<Integer, List<UniqueId>> search(Bean request, PagingRequest pagingRequest) {
// Fetch search results from underlying master
PositionHistoryResult result = ((PositionMaster) getUnderlying()).history((PositionHistoryRequest)
EHCachingSearchCache.withPagingRequest(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
PositionSearchRequest defaultSearch = new PositionSearchRequest();