Search and user experience
Built-in search
Docusaurus includes support for a search function that makes it easy for users to find the right content. The most common solution is Algolia DocSearch, a free service for publicly available documentation.
How it works
When Algolia DocSearch is enabled:
- Automatic indexing – Algolia crawls your site and creates a search index based on the content.
- Fast search results – Users get relevant results in real time as they type in the search box.
- Categorized results – Results are grouped, for example by documentation, blog posts, or other sections of the site.
Search customization options
Docusaurus lets you customize search to suit your needs. Here are a few examples:
- Custom indices – If you do not use Algolia, you can implement your own solutions with other search engines.
- Style the search box – Change the look of the search box with CSS or move it within the navigation.
- Exclude content – Specify which pages or sections should not be indexed, such as internal or temporary pages.
User experience: Optimize for better search results
A good search function does not just make your documentation more accessible — it also improves the user experience. Here are a few tips:
-
Write clear headings – Use informative and specific headings that help the search function find relevant content.
-
Optimize with metadata – Add title and description to each page to help the search engine understand the content.
Example:
---
title: Introduction to APIs
description: An overview of the API structure and basic features.
---
-
Create internal links – Link between related pages to help users explore more content.
-
Test the search function – regularly check that search results are relevant. Adjust content if important pages do not show up as expected.
✨ Next step – How you can customize Docusaurus with themes and interactive elements! ✨