Пример #1
0
        public void FormatResult(SearchResultItem item, ISearchResult formattedResult)
        {
            var contentItem = item.GetItem();

            formattedResult.Title       = contentItem.DisplayName;
            formattedResult.Description = FieldRenderer.Render(contentItem, Templates.Generated.Category.Fields.Description);
            formattedResult.ViewName    = "~/Views/Catalog/_CategorySearchResult.cshtml";
        }
Пример #2
0
        public void FormatResult(SearchResultItem item, ISearchResult formattedResult)
        {
            var product = ProductViewModelFactory.Create(item.GetItem());

            formattedResult.Title       = product.ProductName;
            formattedResult.Description = product.Description;
            formattedResult.Media       = product.DefaultImage;
            formattedResult.ViewName    = "~/Views/Catalog/_ProductSearchResult.cshtml";
        }