@docvia/search
v0.4.0
Published
Section-level Orama indexing and client search helper for docvia
Maintainers
Readme
@docvia/search
Section-level Orama indexing and client search helper for docvia
Part of docvia — a Markdown documentation compiler for React, Svelte, and any framework with a renderer adapter.
Install
pnpm add @docvia/searchUsage
Build the index by compiling your docs (Node / build time):
import { buildSearchIndex } from "@docvia/search/node";
// Compiles the docs in-process (driving a CompileService through the same
// pipeline as the build) and indexes the resulting IR — no emitted JSON to
// read back. `configPath` defaults to "docvia.config.ts"; pass `collection`
// to scope the index to one collection.
const indexJson = await buildSearchIndex({ collection: "docs" });
// → serve `indexJson` as a static assetSearch the index (browser / runtime):
import { createSearch } from "@docvia/search";
const { search } = await createSearch(indexJson);
const hits = await search("getting started", { limit: 8 });For full control, createSearchIndexer() and loadIRDocuments() expose the
indexing and document-loading steps separately.
Documentation
See the main README for the full architecture overview, configuration reference, and examples.
Licence
MIT
