DocShell.Presentation.SearchEntry (DocShell v0.1.0)

Copy Markdown View Source

One searchable document, flattened to plain text.

tokens is a pre-split lowercase form of content, and it is empty unless the producer was asked for it. The shipped Svelte shell indexes title and content itself and never reads them, while they cost roughly three quarters of the size of the text they duplicate — so paying for them by default was paying for nothing. Hosts wiring a search backend that wants the split form set search_tokens: true, either in config :doc_shell or as an option to DocShell.Presentation.StaticGenerator.

audience and locale are null when the producer does not scope entries that way. They are always present so a renderer can filter without first checking which producer it is reading.

Summary

Types

t()

@type t() :: %DocShell.Presentation.SearchEntry{
  audience: String.t() | nil,
  content: String.t(),
  id: String.t(),
  kind: String.t() | nil,
  locale: String.t() | nil,
  path: String.t(),
  title: String.t(),
  tokens: [String.t()]
}