Search documentation
Use the built-in MiniSearch command center and keep results scoped to the reader's active locale.
Press ⌘+K on macOS or Ctrl+K elsewhere to open the command center. Ginko Docs indexes route-backed content with MiniSearch and combines matching documentation and blog entries with site navigation and recent destinations.
Use the default index
The layer enables MiniSearch, so a normal installation needs no search configuration:
export default defineNuxtConfig({
extends: ["@lupinum/ginko-docs"],
});The default index includes public page collections such as docs and, when enabled, blog. Data collections such as authors are not searchable pages. Titles, headings, and body text provide the default search fields.
The command center passes the active Nuxt locale to useContentSearch(). English readers therefore see English hits, and German readers see German hits. Changing the locale refreshes the search state with the new locale instead of mixing both indexes.
Tune MiniSearch
Override only the ranking behavior you need. The layer keeps MiniSearch as the engine while Ginko Content builds and serves the search records:
export default defineNuxtConfig({
extends: ["@lupinum/ginko-docs"],
content: {
search: {
engine: "minisearch",
minisearch: {
fields: ["title", "headings", "content"],
boost: { title: 4, headings: 2, content: 1 },
fuzzy: 0.2,
},
},
},
});fields decides what MiniSearch indexes, boost changes relative ranking, and fuzzy controls typo tolerance. Add a custom frontmatter field to content.search.extraFields before adding it to fields or storeFields.
Write pages that search well
- Give every page a specific
titleanddescription. - Use headings that name the task or concept instead of generic labels such as “Overview”.
- Put the direct answer near the start of the page.
- Keep one topic per page so a result leads to a useful destination.
Search routes come from the content model. Do not maintain a separate list of URLs for the command center.