Docusaurus Integration
AI-powered search component for Docusaurus using Upstash Search.
Features
- 🤖 AI-powered search results based on your documentation
- 🎨 Modern and responsive UI
- 🌜 Dark/Light mode support
Installation
To install the package, run:
Configuration
Enabling the Searchbar
To enable the searchbar, add the following to your docusaurus config file:
The default index name is docusaurus
. You can override it by setting the upstashSearchIndexName
option.
You can fetch your URL and read only token from Upstash Console. Make sure to use the read only token!
If you do not have a search database yet, you can create one from Upstash Console. Make sure to use Upstash generated embedding model.
Indexing Your Documentation
Setting Up Environment Variables
To index your documentation, create a .env
file with the following environment variables:
You can fetch your URL and token from Upstash Console. This time do not use the read only token since we are upserting data.
Running the Indexing Script
After setting up your environment variables, run the indexing command:
Configuration Options
- DOCS_PATH: The indexing script looks for documentation in the
docs
directory by default. You can specify a different path using theDOCS_PATH
option. - UPSTASH_SEARCH_INDEX_NAME: The default index name is
docusaurus
. You can override it by setting theUPSTASH_SEARCH_INDEX_NAME
option. Make sure the name you set while indexing matches with your themeConfigupstashSearchIndexName
option.
For more details on how this integration works, check out the official repository.