External Search Providers

Oxidoc's built-in search handles most documentation sites. For larger sites, existing infrastructure, or specific requirements, you can use an external search provider instead.

When you set an external provider, Oxidoc skips generating the built-in search index and injects the provider's scripts and styles into your pages.

Algolia DocSearch

Algolia DocSearch is a popular hosted search for documentation sites. It's free for open-source projects.

oxidoc.tomltoml
[search]
provider = "algolia"
app_id = "YOUR_APP_ID"
api_key = "YOUR_SEARCH_API_KEY"
index_name = "your_index"
FieldDescription
app_idYour Algolia application ID
api_keySearch-only API key (never use your admin key)
index_nameName of the Algolia index to search
1

Apply for DocSearch

Go to docsearch.algolia.com and apply. Open-source projects get free indexing and hosting.

2

Get your credentials

After approval, Algolia provides your app_id, api_key, and index_name.

3

Configure oxidoc.toml

Add the credentials to your [search] config as shown above.

4

Build and deploy

Algolia's crawler indexes your deployed site automatically. Search works after the first crawl completes.

Search-only API key

Use the search-only API key in your config, not the admin key. The API key is visible in your site's HTML source. The search-only key can only read — it cannot modify your index.

Typesense

Typesense is an open-source, typo-tolerant search engine you can self-host or use as a cloud service.

oxidoc.tomltoml
[search]
provider = "typesense"
host = "your-typesense-host.com"
port = 443
protocol = "https"
api_key = "YOUR_SEARCH_API_KEY"
collection_name = "docs"
FieldDescription
hostTypesense server hostname
portServer port (typically 443 for HTTPS, 8108 for local)
protocol"https" or "http"
api_keySearch-only API key
collection_nameName of the Typesense collection
1

Set up Typesense

Self-host with Docker or use Typesense Cloud.

docker run -p 8108:8108 -v /tmp/typesense-data:/data typesense/typesense:latest \
  --data-dir /data --api-key=your-admin-key
2

Create a collection and index your docs

Use the Typesense API or a scraper like typesense-docsearch-scraper to index your built site.

3

Configure oxidoc.toml

Add your Typesense credentials as shown above. Use a search-only API key.

Meilisearch

Meilisearch is an open-source, fast search engine with typo tolerance and filtering.

oxidoc.tomltoml
[search]
provider = "meilisearch"
host = "https://your-meilisearch-host.com"
api_key = "YOUR_SEARCH_API_KEY"
index_name = "docs"
FieldDescription
hostMeilisearch instance URL (including protocol)
api_keySearch-only API key
index_nameName of the Meilisearch index
1

Set up Meilisearch

Self-host with Docker or use Meilisearch Cloud.

docker run -p 7700:7700 -v /tmp/meili-data:/meili_data getmeili/meilisearch:latest
2

Index your docs

Use the Meilisearch API or docs-scraper to index your built site.

3

Configure oxidoc.toml

Add your Meilisearch credentials as shown above.

Custom Provider

For any search service not listed above, inject your own CSS and JavaScript:

oxidoc.tomltoml
[search]
provider = "custom"
stylesheet = "https://cdn.example.com/search.css"
script = "https://cdn.example.com/search.js"
init_script = "assets/js/search-init.js"
FieldTypeDescription
stylesheetStringCSS file loaded in <head> via <link> tag
scriptStringJS file loaded at end of <body> via <script> tag
init_scriptStringLocal JS file for initialization code (path relative to project root)

All three fields are optional — use the ones you need.

Example: Pagefind

oxidoc.tomltoml
[search]
provider = "custom"
script = "/pagefind/pagefind-ui.js"
stylesheet = "/pagefind/pagefind-ui.css"
init_script = "assets/js/pagefind-init.js"
assets/js/pagefind-init.jsjavascript
new PagefindUI({
  element: "#oxidoc-search-container",
  showSubResults: true,
});
assets/js/search-init.jsjavascript
const input = document.querySelector('.oxidoc-search-input');
input?.addEventListener('input', async (e) => {
  const query = e.target.value;
  const response = await fetch(`/api/search?q=${encodeURIComponent(query)}`);
  const results = await response.json();
  // Render results into the search container
});

Comparison

FeatureBuilt-in (Oxidoc)AlgoliaTypesenseMeilisearchCustom
SetupZero configApply + credentialsSelf-host or cloudSelf-host or cloudWrite JS
HostingNone (runs in browser)Algolia CloudYou or Typesense CloudYou or Meili CloudYou
CostFreeFree (open source)Free (self-host)Free (self-host)
Semantic searchBuilt-inNoNoNo
Typo toleranceBuilt-inBuilt-inBuilt-inBuilt-in
Index size limitNonePlan-dependentNone (self-host)None (self-host)
Offline supportYes (all client-side)No (requires API)No (requires API)No (requires API)
View page sourceLast updated on Mar 17, 2026 by Farhan Syah