This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

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

options SearchIndexOptions
localization LocalizationOptions

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

toc ContentTocItem
The page's table-of-contents entry (title, description, section, tags).
section HeadingSection
The heading section to map (or the page-lead section).
metadata IFrontMatter
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. Pass null for pages with no record (the built-in facets still apply).

Returns

SearchDocument

Pennington.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)
; }