SearchIndexBuilder Pennington.Search
Maps a page's HeadingSections onto DeweySearch SearchDocument records — one record per heading (plus a page-lead record) so search results are heading-level and deep-link to anchors. This is the Pennington-specific adapter: it builds anchor URLs, the page→heading breadcrumb trail, and maps the content model (section label, tags, content area) onto DeweySearch's open facet dictionary. Draft filtering is handled upstream by each IContentService's TOC builder.
Constructors
SearchIndexBuilder
#public SearchIndexBuilder(SearchIndexOptions options, LocalizationOptions localization)
Creates the adapter from the search options and localization (for content-area derivation).
Parameters
optionsSearchIndexOptionslocalizationLocalizationOptions
Methods
BuildSection
#public SearchDocument BuildSection(ContentTocItem toc, HeadingSection section, IFrontMatter metadata = null)
Builds a DeweySearch SearchDocument for one section of a page. The lead section becomes the page record (page URL, page title, page description); each heading section becomes an anchored record carrying the page→heading breadcrumb trail.
Parameters
tocContentTocItem- The page's table-of-contents entry (title, description, section, tags).
sectionHeadingSection- The heading section to map (or the page-lead section).
metadataIFrontMatter- The page's record front matter, when available. When it implements
IHasSearchFacets, its custom facet axes are emitted alongside the built-in section/tag/area dimensions. Passnullfor pages with no record (the built-in facets still apply).
Returns
SearchDocumentPennington.Search.SearchIndexBuilder
namespace Pennington.Search;
/// Maps a page's HeadingSections onto DeweySearch SearchDocument records — one record per heading (plus a page-lead record) so search results are heading-level and deep-link to anchors. This is the Pennington-specific adapter: it builds anchor URLs, the page→heading breadcrumb trail, and maps the content model (section label, tags, content area) onto DeweySearch's open facet dictionary. Draft filtering is handled upstream by each IContentService's TOC builder.
public class SearchIndexBuilder
{
/// Builds a DeweySearch SearchDocument for one section of a page. The lead section becomes the page record (page URL, page title, page description); each heading section becomes an anchored record carrying the page→heading breadcrumb trail.
public SearchDocument BuildSection(ContentTocItem toc, HeadingSection section, IFrontMatter metadata = null)
;
/// Creates the adapter from the search options and localization (for content-area derivation).
public SearchIndexBuilder(SearchIndexOptions options, LocalizationOptions localization)
;
}