Docusaurus does not include a built-in search engine, but it integrates seamlessly with several search solutions. Algolia DocSearch is the officially supported option, while Typesense DocSearch and community local search plugins are maintained by the community.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/facebook/docusaurus/llms.txt
Use this file to discover all available pages before exploring further.
Algolia DocSearch
Official, free for developer docs. Hosted crawler indexes your site weekly.
Typesense DocSearch
Open-source alternative to Algolia. Self-host or use Typesense Cloud.
Local search
Index downloaded to the browser. Best for small sites or private deployments.
Custom SearchBar
Swizzle the
SearchBar component to build your own search experience.Algolia DocSearch
Algolia DocSearch is free for any open-source or developer documentation site. Apply athttps://docsearch.algolia.com/apply/. Algolia crawls your site once a week and aggregates all content into an Algolia index that is queried directly from your frontend.
The Docusaurus classic preset generates a
sitemap.xml automatically. Algolia’s crawler uses this sitemap to discover pages efficiently.Configuration
If you use@docusaurus/preset-classic, no extra installation is needed — Algolia integration is built in. Add the algolia key to your themeConfig:
docusaurus.config.js
Contextual search
Contextual search is enabled by default. It automatically scopes search results to the version and language the user is currently browsing:- On
/en/docs/v2/myDoc, results include only English v2 docs. - On
/fr/docs/v1/myDoc, results include only French v1 docs.
docusaurus.config.js
facetFilters manually:
docusaurus.config.js
Ask AI
Ask AI brings conversational search to your documentation. Users can ask natural-language questions and receive context-aware answers sourced from your Algolia index:docusaurus.config.js
Styling the search modal
Override Algolia’s CSS variables using Infima CSS variables from yoursrc/css/custom.css:
src/css/custom.css
Troubleshooting: no search results
No results typically indicates an index configuration problem. Docusaurus uses Algolia faceting for contextual search, which requires the following facet fields to be configured on your index:docusaurus_tag, language, lang, version, type.
Use the recommended crawler config
Apply the official Docusaurus v3 crawler configuration from the Algolia documentation. Using a custom config is not supported.
Delete and re-create the index
Delete your Algolia index through the Algolia UI, then trigger a new crawl to fully reinitialize it with the correct faceting settings.
Typesense DocSearch
Typesense is an open-source instant-search engine you can self-host or run on Typesense Cloud. The integration uses two components:typesense-docsearch-scraper— crawls your site and indexes into Typesense.docusaurus-theme-search-typesense— the search bar UI component.
Local search
Local search downloads the entire search index to the user’s browser. It works well for smaller sites or documentation that is behind a firewall and cannot be crawled by Algolia. Community-supported local search plugins are listed athttps://docusaurus.io/community/resources#search. Install and configure the plugin of your choice following its documentation.
Custom search component
If none of the existing solutions fit your needs, swizzle theSearchBar component from the classic theme and implement your own:
src/theme/SearchBar/index.js in your project. Restart the dev server and edit the component — Docusaurus will use your version instead of the default.