For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Getting started
    • Overview
    • How it works
    • Quickstart
    • Project structure
    • Customer showcase
    • Changelog
  • Configuration
    • Overview
    • Site-level settings
    • Page-level settings
  • Writing content
    • Markdown basics
    • Rich media in Markdown
    • Fern Editor
    • Reusable snippets
  • AI features
    • Overview
    • Fern Writer
    • AI-generated examples
    • Markdown access
      • Overview
      • Customize LLM output
      • Agent directives
      • Analytics and integration
    • MCP server
    • API catalog discovery
      • Announcement banner
      • Embedded mode
      • Hiding content
      • Search
      • User feedback
      • Custom CSS & JS
      • CSS selectors reference
      • Custom React components
      • Header and footer
      • Global themes
  • Public API
    • GETJWT from Fern API key
    • GETAlgolia search credentials
    • GETCurrent user information
  • Fern Writer API
    • GETGet Fern Writer Install Link
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • How search works
  • Scope search by product or version
  • How results are ranked
  • Integrating with Algolia
  • Making search requests
  • Using an alternative search
Customization

Search configuration

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Hiding content in your site

Next

Collecting feedback and suggestions from users

Fern uses Algolia DocSearch to power search for your documentation. DocSearch is designed specifically for documentation sites to help users find what they need.

How search works

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:

  • Product: Narrows results to a specific product in your documentation (for sites with multiple products)
  • Version: Filters results by documentation version (for sites using versioned docs)
  • Content type: Filters results by guides, changelog entries, or API endpoints
  • API type: Filters API results by protocol (HTTP, webhooks, WebSockets, or gRPC)
  • HTTP method: Filters API results by HTTP method (GET, POST, PUT, DELETE, etc.)
  • Status code: Filters API results by HTTP status code
  • Availability: Filters API results by availability status, including Stable, Beta, and Deprecated
Fern's own docs site shows Product, Content type, and HTTP method filters. Other filters, like Version, don't appear because this site doesn't use versioned docs.

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.

Scope search by product or version

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:

docs.yml
1settings:
2 search:
3 prioritize-current-product: true

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.

How results are ranked

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.

Attribute weighting

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:

PriorityAttributeDescription
1KeywordsKeywords set in the page’s frontmatter. Use these to surface a page for queries without changing its content.
2Page titleThe title set in frontmatter or docs.yml
3Heading hierarchy (h1–h6)Headings within the page, from h1 (highest) to h6 (lowest)
4Endpoint pathThe API endpoint path (e.g., /plants/{plantId})
5Endpoint path alternatesAlternative representations of the endpoint path
6Parameter nameNames of API parameters
7Metadata attributesAvailability, API type, HTTP method, content type, response type, status code, and parameter type
8BreadcrumbThe navigation breadcrumb trail for the page
9DescriptionThe page’s meta description
10Body contentThe full body text of the page
11Code snippetsCode blocks embedded in the page

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.

Tiebreaking

When multiple results have the same text relevance score, Fern applies custom ranking rules as tiebreakers:

  1. Date (descending): Newer content ranks higher. This primarily affects changelog entries, which carry a timestamp.
  2. Version index (ascending): Content from the default version ranks above content from older versions. This prevents duplicate results across versioned docs.
  3. Page position (ascending): Content closer to the top of a page ranks above content further down. For example, a heading match near the top of a page outranks a section match further down on the same page.

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.

Page hierarchy

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.

Empty result handling

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.

Integrating with Algolia

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.

Making search requests

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.

Using an alternative search

You can override Fern’s search with your own solution using custom JavaScript and your Algolia credentials.