Algolia DocSearch
Integrate Algolia DocSearch to power your documentation with high-performance cloud indexing.
For large documentation sites, you can replace the default local FlexSearch index with Algolia DocSearch. Algolia crawls your documentation pages in production, indexes them on their cloud servers, and provides synonym mapping, advanced search analytics, and cloud-hosted speed.
Algolia DocSearch is free for public open-source projects. You can apply for a container at docsearch.algolia.com.
Configuration Reference
| Option | Type | Required | Description |
|---|---|---|---|
appId | string | ✓ | Your Algolia Application ID (e.g. 'MX2L9K40B1'). |
apiKey | string | ✓ | The public search-only key. Don't use your admin API key here since it gets exposed in client bundles. |
indexName | string | ✓ | The name of the index containing your crawled pages (e.g. 'boltdocs'). |
Troubleshooting and Staging Environments
Localhost returns no results
Algolia DocSearch depends on crawling your public production site. It doesn't index localhost, private URLs, or staging pipelines by default.
Solution: If you're testing locally, you can temporarily comment out the algolia config block. When the algolia config is missing, Boltdocs automatically falls back to using the client-side offline FlexSearch index so you can test search behaviors locally.
Analytics and Synonyms
To customize search behaviors, manage synonyms, or inspect queries users are searching for, log in to the Algolia Dashboard and navigate to the Search Analytics tab corresponding to your configured indexName.