Skip to content

jstemerdink/EPi.Libraries.BlockSearch

Repository files navigation

Add block content to the index of EPiServer Search.

Build status GitHub version Platform Platform GitHub license Quality Gate Status NuGet

About

Add Blocks used on a page to EPiServer Search Index as content of the page they were used on. This is supported in Find, but not if you use EPiServer Search. You need an extra property to your base class, or a specific pagetype to hold the content of the Blocks. Note the ScaffoldColumn(false) attribute, which hides it in edit mode. [CultureSpecific] [ScaffoldColumn(false)] [Searchable] [AdditionalSearchContent] public virtual string SearchText { get; set; } The aggregated content from string properties marked Searchable in the Blocks are added to the property marked with [AdditionalSearchContent]. Note: If for some reason you don't want a property on a Block indexed, just add [Seachable(false)] to it. The content of the property marked with ```[AdditionalSearchContent]`` is added to the index and you get results also if the term you are looking for is only used in a Block on the page.

Powered by ReSharper image