logo
On this page

Search

Using Algolia DocSearch

Docuo has official support for Algolia DocSearch.

The service is free for any developer documentation or technical blog: just make sure to read the checklist and apply to the DocSearch program.

DocSearch crawls your website once a week (the schedule is configurable from the web interface) and aggregates all the content in an Algolia index. This content is then queried directly from your front-end using the Algolia API.

If your website is not eligible for the free, hosted version of DocSearch, or if your website sits behind a firewall and is not public, then you can run your own DocSearch crawler.

NOTE

By default, the Docuo preset generates a sitemap.xml that the Algolia crawler can use.

FROM THE OLD DOCSEARCH?

You can read more about migration from the legacy DocSearch infra in the DocSearch migration docs.

Index Configuration

After your application has been approved and deployed, you will receive an email with all the details for you to add DocSearch to your project. Editing and managing your crawls can be done via the web interface. Indices are readily available after deployment, so manual configuration usually isn't necessary.

Modifying Crawler Configuration

Next you need to modify the crawl configuration as follows to ensure that you can crawl to all pages of your site.

  1. Log in to crawlers background.
  2. Select the corresponding crawler.
  1. Go to Editor page
  1. Enter the sitemap file address, which is "YOUR DOMAIN/sitemap.xml".
  1. Crawling the page again.

Connecting Algolia

Add an algolia field in your search. Apply for DocSearch to get your Algolia index and API key.

docuo.config.json
{
  // ...
  "search": {
    "algolia": {
      "appId": "YOUR_APP_ID",
      "apiKey": "YOUR_API_KEY",
      "indexName": "YOUR_INDEX_NAME"
    }
  }
}
1
Copied!
WARNING

The search feature will not work reliably until Algolia crawls your site.

If search doesn't work after any significant change, please use the Algolia dashboard to trigger a new crawl.

Manage layout

If you don't need the search function on your website, you can remove the component via hidden.

docuo.config.json
{
  "search": {
    "hidden": true
  }
}
1
Copied!