Quartz search

How search works in Quartz 5 (@quartz-community/search) — findings from
reading the shipped bundle and live-testing garden.h (2026-09-13). See
Quartz modifications for our other engine customizations.

Architecture

  • Corpus: build emits static/contentIndex.json (garden.h: 324 KB, one
    entry per published slug; fields title, content, tags, links).
    Content is plain-text — frontmatter included as properties text.
  • Index: client-side FlexSearch, fetched from jsDelivr CDN at
    runtime; fetchData global (injected <script> in every page) resolves
    the JSON with the right base path. Zero backend, instant on 45 notes.
  • Encoder: custom, CJK-aware — lowercases, keeps CJK codepoints whole,
    splits on whitespace. tokenize: "forward" on all three fields.
  • UI: Ctrl/Cmd+K opens, #tag syntax filters by tag, preview panel
    fetches the full page HTML per result, 8–10 results shown, keyboard
    navigation.

Config surface (all of it)

- source: "@quartz-community/search"
  enabled: true
  options:
    enablePreview: true        # content preview panel (default true)
    fieldPriority: [title, content, tags]  # ranking field order
  # placeholder/title texts come from `locale:` (UI strings only)

No knobs for tokenizer, stemming, fuzziness, or result count — compiled
into the plugin. TypeScript override (quartz.ts) is the only escape hatch.

Live findings (garden.h, 45 notes)

  • programowanie, programowa → 10 hits, correct note ranked #1 —
    prefix matching works
  • ssue → 0 hits — no mid-word/substring matching (forward tokenizer)
  • Polish diacritics pass through unnormalized (ąa), no stemming
    exact word forms match (tags fine), inflected queries miss
    (“programowania” finds nothing)

Decisions

  • Keep stock config — options that exist are already at sensible values;
    nothing worth tuning at this corpus size.
  • No Pagefind — no quartz-community plugin exists; hand-wiring a
    fragment buys stemming/fuzzy that only matters at much larger scale.
  • Known gap: inflected-Polish queries. Client-side FlexSearch cannot do
    stemming/diacritics folding. If that starts hurting, the fix is a
    server-side hybrid index (QMD-style BM25 + vectors), not plugin config.