Skip to main content

Choose a search engine

Select MiniSearch, Pagefind, provider search, or an external service based on how content is built and published.

Choose the backend that matches how the site ships content:

RequirementChoose
Small-to-medium content site, static or SSR outputMiniSearch
Larger generated site that benefits from shard loadingPagefind
A content provider already indexes your contentProvider search
Hosted ranking, analytics, typo tuning, or a very large corpusExternal service

Search is disabled by default. Set content.search: {} to enable MiniSearch, or choose another engine explicitly.

Use MiniSearch for a compact site

MiniSearch is the default engine. Ginko serves a JSON record set, and useContentSearch creates the in-browser index.

The defaults index titles, headings, and body text. Add a frontmatter field to extraFields before using it in MiniSearch options:

nuxt.config.ts
content: {
  search: {
    engine: 'minisearch',
    extraFields: ['tags'],
    minisearch: {
      fields: ['title', 'content', 'headings', 'tags'],
      boost: { title: 4, headings: 2, tags: 3, content: 1 },
      fuzzy: 0.2
    }
  }
}

fields controls what MiniSearch indexes. boost weights relevance, and fuzzy controls typo tolerance. When collections is omitted, Ginko indexes public route-backed collections and excludes data collections.

useContentSearch downloads the complete JSON record set when it initializes. Measure its compressed size and time to first result. Move to Pagefind when that transfer becomes material.

Use Pagefind for generated sites

Pagefind writes sharded search assets during static generation and loads them on demand. Install the optional peer dependency:

terminal
pnpm add -D pagefind
nuxt.config.ts
content: {
  search: {
    engine: 'pagefind'
  }
}

Run pnpm generate, then deploy the complete public output, including the pagefind/ directory. Test the generated output because the development server does not prove those static assets were shipped.

useContentSearch stays the same because Ginko normalizes Pagefind, MiniSearch, and provider hits to one result shape.

Pagefind only sees the last generated site. Content added after a build will not appear until you regenerate and redeploy. For independently published content, use provider search or serve the MiniSearch index from a dynamic deployment.

Use the provider's search index

When a content provider already owns a search index, set engine: 'provider'. The provider returns route fields, and Ginko builds the public result paths. Provider search and caching shows the implementation and invalidation flow.

Use an external search product

Use a service such as Algolia, Meilisearch, or Typesense when you need hosted ranking, analytics, synonyms, or facets. These integrations sit outside useContentSearch; map every result back to its public content route.