Fern uses Algolia DocSearch to power search for your documentation. DocSearch is designed specifically for documentation sites to help users find what they need.
DocSearch scans your Fern site’s content and builds an index to generate search results. It includes built-in dropdown filters that appear dynamically based on your site’s configuration, letting users refine their searches:
GET, POST, PUT, DELETE, etc.)Pages with the nofollow or noindex frontmatter are excluded from the Algolia DocSearch index and won’t appear in search results.
For sites with localized docs, search is automatically scoped to the reader’s active language. For multi-source sites, search scope across sub-paths (hierarchical vs. unified) is configured per-domain in the Fern Dashboard.
If you’re using Ask Fern (AI search), the search box also functions as your site’s chat window.
For sites with multiple products or versions, the settings.search object in docs.yml scopes search results to the reader’s current context (their active product and version). Two options are available:
prioritize-current-product — Softer. Boosts current-context results in ranking but still surfaces matches from other products and versions.default-filter-by-current-product — Stricter. Hides results outside the current context by default; users can remove the filter from the search UI to broaden their search.Most sites pick one. For example, to boost current-context results without hiding anything else:
These settings apply to keyword search only. Ask Fern queries the same Algolia index and benefits from its global ranking, but doesn’t receive the per-product boost from prioritize-current-product.
Fern configures Algolia’s ranking to prioritize matches in high-signal attributes like titles and keywords over body text, then applies tiebreakers for recency, version, and page position.
Algolia ranks results based on which attributes contain the matching text. Attributes listed earlier are weighted higher than those listed later. Fern configures the following searchable attributes, in order of priority:
All attributes use unordered matching, meaning that the position of the query terms within an attribute doesn’t affect ranking. For example, a match at the end of a page title ranks the same as a match at the beginning.
When multiple results have the same text relevance score, Fern applies custom ranking rules as tiebreakers:
Additionally, Fern deduplicates results by canonical pathname, so each page appears at most once in the results. The version index and page position tiebreakers determine which record represents the page when duplicates exist.
The navigation hierarchy of your documentation doesn’t directly affect search ranking. A nested page ranks the same as a top-level page for text relevance purposes. However, within a single page, heading depth does matter: matches in h1 headings rank above h2, h2 above h3, and so on. The heading hierarchy is stored per record, so Algolia can distinguish between a match in a top-level section and one in a subsection.
If a query returns no results, Algolia progressively removes common documentation terms to broaden the search. The following words are treated as optional when no exact matches are found: endpoint, api, guide, documentation, doc, parameter, webhook, websocket, http, code, and snippet.
For example, a search for webhook endpoint that returns no results is retried as webhook and endpoint individually.
If you need to integrate Fern’s documentation search into your own application or dashboard, you can use the standalone search widget to embed a ready-made React component, or request Algolia credentials directly from the Fern team to build a custom integration.
Once you have your credentials, you can make requests to Algolia’s API to search your documentation.
Contact the Fern team to get your specific application ID and index name. Credentials are provided on a per-customer basis to maintain security.
Note: Keep your Algolia credentials secure and avoid exposing them in client-side code. Consider implementing a backend proxy to make the Algolia requests.
You can override Fern’s search with your own solution using custom JavaScript and your Algolia credentials.