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.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add block content to the index
License
jstemerdink/EPi.Libraries.BlockSearch
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Add block content to the index
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published