1. Home
  2. ChevronRightSearch
  3. ChevronRightAlgolia DocSearch

Algolia DocSearch

Integrate Algolia DocSearch to power your documentation with high-performance, cloud-hosted indexing.

For large documentation sites, you can replace the default local FlexSearch index with Algolia DocSearch. Algolia crawls your production documentation pages, 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.


Configuring AlgoliaLink

To enable Algolia, register your credentials under the integrations.algolia key in boltdocs.config.ts:

boltdocs.config.ts
import { defineConfig } from 'boltdocs'

export default defineConfig({
  integrations: {
    algolia: {
      appId: 'YOUR_APP_ID',
      apiKey: 'YOUR_SEARCH_ONLY_API_KEY', // Public search-only API key
      indexName: 'YOUR_INDEX_NAME',
    },
  },
})

Once configured, Boltdocs automatically hooks the search bar components (SearchDialog and the useSearch hook) to fetch query matches from Algolia instead of parsing the local FlexSearch offline index.


Configuration ReferenceLink

OptionTypeRequiredDescription
appIdstringYour Algolia Application ID (e.g. 'MX2L9K40B1').
apiKeystringThe search-only public API key. Do not use your admin write API key here as it is exposed in client bundles.
indexNamestringThe name of the index containing your crawled pages (e.g. 'boltdocs').

Troubleshooting & Staging environmentsLink

Localhost returning zero resultsLink

Algolia DocSearch relies on crawling your public production site. It does not index localhost, private URLs, or staging pipelines by default.

Solution: If you are testing locally, you can temporarily comment out the algolia configuration block. When the algolia config is missing, Boltdocs automatically falls back to utilizing the default client-side FlexSearch index so you can test search behaviors locally.

Analytics and SynonymsLink

To customize search behaviors, dashboard synonyms, or inspect queries that users search for, log into the Algolia Dashboard and navigate to the Search Analytics tab matching your configured indexName.

Last updated on July 27, 2026

Was this page helpful?