authentikate/docs/algolia-docsearch.md
2025-08-04 18:41:00 -04:00

32 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Algolia DocSearch
description: Configure Algolia DocSearch with the Jigsaw docs starter template
extends: _layouts.documentation
section: content
---
# Algolia DocSearch {#algolia-docsearch}
This starter template includes support for [DocSearch](https://community.algolia.com/docsearch/), a documentation indexing and search tool provided by Algolia for free. To configure this tool, youll need to sign up with Algolia and set your API Key and index name in `config.php`. Algolia will then crawl your documentation regularly, and index all your content.
[Get your DocSearch credentials here.](https://community.algolia.com/docsearch/#join-docsearch-program)
```php
// config.php
return [
'docsearchAppId' => '',
'docsearchApiKey' => '',
'docsearchIndexName' => '',
];
```
Once the `docsearchAppId`, `docsearchApiKey` and `docsearchIndexName` values are set in `config.php`, the search field at the top of the page is ready to use.
<img class="block m-auto" src="/assets/img/docsearch.webp" alt="Screenshot of search results" />
To help Algolia index your pages correctly, it's good practice to add a unique `id` or `name` attribute to each heading tag (`<h1>`, `<h2>`, etc.). By doing so, a user will be taken directly to the appropriate section of the page when they click a search result.
---
For more details, visit the [official Algolia DocSearch documentation.](https://community.algolia.com/docsearch/what-is-docsearch.html)