public override ActionResult Index(CustomizedSearchSettings currentBlock) { var customizedSearchBlock = GetParentCustomizedSearchBlock(currentBlock); var search = _searchBlockService.CreateSearchQuery(customizedSearchBlock); var results = search.StaticallyCacheFor(TimeSpan.FromMinutes(5)).GetResult(); // cache search results for 5 minutes var items = results.Select(h => new LinkWithImage {Title = h.Title, ImageUri = h.ImageUri, Url = h.Url}).ToList(); var model = new SearchBlockWithImagesModel {Items = items}; return PartialView("Index", model); }
public override ActionResult Index(CustomizedSearchSettings currentBlock) { var model = CreateSearchResultsViewModel(currentBlock); return PartialView("Index", model); }