Overview
The Orama Database generator creates a searchable database using the Orama search engine. It indexes API documentation with hierarchical titles, descriptions, and site sections for fast client-side search.Metadata
Generator identifier
Generator version
Requires metadata generator output as input
Configuration
Output directory path for the generated database file
Enable JSON minification of the database file
Output Format
The generator produces:- Database file:
orama-db.json - Format: Orama database format with indexed documents
- Schema:
title: Hierarchical title (e.g., “fs > readFile”)description: First paragraph of entry contenthref: Link to entry (e.g.,fs.html#read-file)siteSection: Top-level API module name
Usage
Dependency Chain
- ast - Parses Markdown to AST
- metadata - Extracts API metadata
- orama-db - Indexes into searchable database
Implementation Details
The generator:- Creates an Orama database instance with predefined schema
- Groups nodes by API module
- Builds hierarchical titles showing the path to each entry
- Extracts first paragraph as description
- Inserts all documents in batch
- Saves serialized database to JSON file
Schema Definition
The Orama database uses this schema (fromconstants.mjs):
Hierarchical Titles
ThebuildHierarchicalTitle function creates breadcrumb-style titles:
- Shows the path from module to specific entry
- Example:
"File System > fs.readFile > Synchronous API" - Helps users understand context in search results
Description Extraction
The generator:- Finds the first paragraph node in entry content
- Converts to plain text using
transformNodeToString - Strips markdown formatting for clean descriptions
src/generators/orama-db/