My App

Orama Local Search Implementation

Guide to implementing local Orama search indexing in your documentation site

Fumadocs implements local Orama search indexing. It's in the packages/core/src/search/ directory of the monorepo.

Location of Implementation

The Orama search implementation is located in:

  • packages/core/src/search/orama/ - All Orama-specific code
  • packages/core/src/search/server.ts - Main API factory

Quick Start

1. Install the Package

npm install fumadocs-core @orama/orama

2. Create an API Route

Create a file like app/api/search/route.ts in your Next.js project:

import { source } from '@/lib/source'; // Your content source
import { createFromSource } from 'fumadocs-core/search/server';

export const { GET } = createFromSource(source, {
  language: 'english',
});

3. Use Search on the Client

import { useDocsSearch } from 'fumadocs-core/search/client';

const { search, setSearch, query } = useDocsSearch({
  type: 'fetch',
});

Key Features

  • Two search modes: Simple (basic full-text) and advanced (with heading/content segmentation)
  • i18n support: Multi-language search with 30+ languages
  • Tag filtering: Filter results by custom tags
  • Static export: Pre-generate search indexes for static sites
  • Orama Cloud: Option to use cloud-hosted search instead

Reference Files

  • packages/core/src/search/orama/create-from-source.ts - Main entry point
  • packages/core/src/search/orama/create-db.ts - Database schema
  • examples/next-mdx/app/api/search/route.ts - Simple example
  • examples/i18n/app/api/search/route.ts - i18n example

The implementation abstracts away most Orama complexity—just pass in your content source and it handles indexing automatically!

On this page