Search
This project uses Algolia, a powerful hosted search engine that delivers instant, full-text search results as you type. It's designed for speed, scalability, and relevance.
When integrated with Docusaurus, Algolia provides a seamless search experience through its DocSearch service. DocSearch crawls and indexes your Docusaurus site, allowing users to quickly find relevant content across all pages and documentation versions.
How It Works
- Algolia’s crawler automatically scans your site at regular intervals.
- Indexed content is stored in Algolia’s search backend.
- A lightweight, customizable search UI (provided by DocSearch) is embedded in your Docusaurus site.
- Users can search titles, content, headers, and metadata with fast, accurate results.
Configuration
The Algolia search integration is configured in your docusaurus.config.js
file under the themeConfig.algolia
section.
The following information has been entered from the RMC Software Documentation project's Algolia account:
- appId: Your Algolia application ID
- apiKey: Public API key (search-only)
- indexName: The name of your Algolia index
Current configuration:
themeConfig: {
algolia: {
appId: "5IPYQGAW1I",
apiKey: "797fecb09f4d22f8050f47976027c58c",
indexName: "usace-rmcio",
}
Indexing and Versioning
The scripts/versions.js
script generates JSON files in static/versions/
to help Algolia index the correct documentation versions.
Algolia’s crawler uses these files to determine which URLs to index and how to handle versioned docs.
Usage
The search bar appears at the top of every documentation page.
Start typing to see instant results from all indexed content.
Results include:
- Page titles
- Headings
- Content snippets
These features enable quick navigation across the site.
Security
The API Key displayed above is the search API key, safe for public repository. Never expose the project's Algolia Admin API Key in public repositories or in any client-side code.