Installation
Install the plugin using your preferred package manager:For Docusaurus v2, use the legacy
@orama/plugin-docusaurus package instead.Configuration
Add the plugin to yourdocusaurus.config.js file:
docusaurus.config.js
Local Search (OSS Mode)
For local search without cloud dependencies, use the basic configuration:docusaurus.config.js
- Indexes all docs, blog posts, and pages during build
- Creates a compressed search index (
.json.gzformat) - Provides instant client-side search
- Works completely offline
Cloud Search
For cloud-powered search with Orama Cloud, add cloud configuration:docusaurus.config.js
Deploy Types
Controls how the index is deployed to Orama Cloud:
default: Resets and deploys the index automatically after buildsnapshot-only: Only creates a snapshot without deploying
Configuration Options
Cloud Configuration
Your Orama Cloud index ID (legacy v1). Required if not using
collectionId.Your Orama Cloud collection ID (v2). Required if not using
indexId.Your Orama Cloud public API key for search operations.
Deployment strategy for the search index.
Search UI Configuration
Configuration for the search input component. Accepts any options from the Orama Searchbox component.
Configuration for the search button that triggers the search modal.
Analytics Configuration
Enable analytics tracking for search queries.
What Gets Indexed
The plugin automatically indexes content from:- Documentation
- Blog Posts
- Pages
All documentation pages from
@docusaurus/plugin-content-docs, including:- Page titles
- Headings (h1-h6)
- Content sections
- Version information
- Category metadata
Search Index Structure
Each indexed document includes:Advanced Usage
Custom Search Configuration
Customize the search behavior with advanced options:docusaurus.config.js
Environment Variables
For security, use environment variables for sensitive data:docusaurus.config.js
Build Process
The plugin hooks into the Docusaurus build lifecycle:- Content Loading: Extracts content from all docs, blogs, and pages
- Markdown Parsing: Converts markdown to HTML and extracts sections
- Index Creation: Builds the search index with all extracted content
- Compression: Creates a gzipped index file for optimal performance
- Deployment: Optionally syncs the index to Orama Cloud
Build Output
For OSS mode, the plugin generates:Theme Integration
The plugin automatically integrates with the Docusaurus theme:- Replaces the default search bar
- Provides custom styling that matches your theme
- Supports light and dark mode
- Responsive design for mobile and desktop
Local Development
When developing locally with the plugin:Troubleshooting
Search not working after build
Search not working after build
Ensure the search index file is being generated in your build output. Check the
build/ directory for orama-search-index-current.json.gz.Cloud deployment fails
Cloud deployment fails
Verify your API key and index ID are correct. Check that your API key has the necessary permissions for deploying indexes.
Search results are empty
Search results are empty
Make sure your content has actual text to index. Check that your markdown files contain searchable content beyond just frontmatter.
Package Information
- Package Name:
@orama/plugin-docusaurus-v3 - Version: 3.1.18
- License: Apache-2.0
- Repository: github.com/oramasearch/orama
Requirements
- Docusaurus v3.x
- Node.js >= 16
- Peer dependencies:
@docusaurus/plugin-content-docs^3@docusaurus/theme-common^3@docusaurus/utils^3
Next Steps
Search Guide
Learn more about Orama search features
Analytics Plugin
Track and analyze search behavior
Core Database
Learn about Orama database configuration
Full Documentation
View the complete Docusaurus guide