DocSearch Documentation

website·Indexed 54 days ago

https://docsearch.algolia.com/

Official documentation for DocSearch by Algolia. Covers implementation and configuration for versions v1.x through v4.x, including crawler setup, Python-based scraping, sitemap integration, and templates for website generators like Docusaurus, Astro Starlight, and Vuepress. Includes guides on the Algolia Crawler Visual UI, sidepanel API reference, and the migration of Ask AI to Agent Studio.

Tokens
48.3K
Snippets
88
Records
248
Agent score
50%

What's inside DocSearch

  1. Overview of Ask AI API for custom chat interfaces

    v4

    The Ask AI API allows developers to build custom chat interfaces powered by Algolia's AI assistant. It enables creating conversational experiences that search an Algolia index and generate contextual responses using a user-provided LLM provider.

    Note for DocSearch users: If you are using the standard DocSearch package, the Ask AI API integration is handled automatically and you typically do not need to interact with these endpoints directly.

    Migration Warning: Ask AI is being migrated from a standalone DocSearch feature into Algolia's Agent Studio. DocSearch v5 will transition to using Agent Studio fully.

  2. Overview of DocSearch v4 migration and new features

    DocSearch v4 has migrated its infrastructure to leverage the Algolia Crawler. Key changes include:

    • Managed Scraping: Instead of running a local scraper, DocSearch now uses the Algolia Crawler. You can manage crawls, schedule them, and monitor them via the Algolia Crawler dashboard (https://dashboard.algolia.com/crawler).
    • No Local Tooling Required: You no longer need to install and maintain local scraping tools to update your index.
    • Live Configuration: You can edit your configuration file using a live editor in the crawler dashboard.
    • Direct Algolia Integration: DocSearch now operates within your own Algolia application, allowing you to manage team members, browse indexed records, and access other Algolia features directly.
  3. Overview of DocSearch Scraper (Legacy v1.x - v2.x) mechanism

    The DocSearch scraper (Legacy versions 1.x - 2.x) is a Python-based tool inspired by the Scrapy framework. It crawls a website by following all internal links and extracts content from the HTML structure to populate an Algolia index.

    By default, the scraper uses HTML semantics to build the index hierarchy: h1, h2, etc., are used as titles to establish hierarchy, and <p> tags are treated as potential search results. These default CSS selectors can be customized via a JSON configuration file to match a specific website's structure.

  4. Overview of DocSearch by Algolia

    DocSearch is a search engine purpose-built for documentation and blogs. It is designed to index and surface technical content such as API references, how-to guides, code snippets, tables, and markdown structures.

    Key features include:

    • AI-Powered Search: Uses Algolia Ask AI to interpret natural-language queries and suggest synonyms.
    • High Performance: Built on Algolia's global infrastructure, providing sub-20 ms response times.
    • Customizable UI: Supports branding via CSS variables and JS hooks for colors, fonts, and layouts.
    • Accessibility: Follows WAI-ARIA best practices and is tested against WCAG 2.1 standards for keyboard and screen-reader support.
    • MCP Server Support: Allows connecting documentation to AI assistants (like Claude and Cursor) via the Model Context Protocol.
  5. Manage and monitor crawls in Algolia Crawler UI

    The Algolia Crawler Visual UI allows you to control the crawling lifecycle and monitor performance:

    • Control Crawls: Use the Overview section to start, restart, or pause crawls and view real-time summaries.
    • Monitor Errors: Use the Monitoring section to identify crawl errors and troubleshoot search result quality.
    • Review Suggestions: The Suggestions section provides actionable feedback after each crawl, including recommendations for fixing redirects/domain issues, addressing ignored or failed URLs, and adding missing sitemaps.
  6. Access DocSearch implementation code and API keys

    The DocSearch tab in the Algolia Crawler Visual UI (v4.x) provides the necessary assets to integrate DocSearch into your frontend. It contains:

    • Implementation code: Ready-to-use code snippets for frontend integration.
    • API keys: Your unique Application ID and Search API Key required to connect your site to your Algolia index.
    • Quick links: Links to review records, documentation, and support.
  7. Manage and monitor DocSearch crawls via the Algolia Crawler web interface

    The Algolia Crawler web interface (https://crawler.algolia.com/) allows you to manage the population of your Algolia index.

    Note: This UI is deprecated. For the latest instructions and the current interface, use the Crawler Configuration Visual UI at dashboard.algolia.com/crawler.

    Key capabilities of the interface include:

    • Crawl Control: In the Overview section, you can start, restart, or pause crawls and view real-time summaries.
    • Monitoring: The monitoring section allows you to identify crawl errors and improve search results.
    • Configuration: Use the live editor to update your configuration file.
    • Testing: Use the URL tester within the editor to debug selectors or verify how the crawler interacts with your website.
    • Search Preview: Access a Search preview tab from the editor to browse search results using DocSearch v3.
  8. Manage and monitor Algolia Crawler crawls

    v3

    The Algolia Crawler Visual UI allows you to control and observe the indexing process through several sections:

    • Overview: Use this section to start, restart, or pause crawls and view a real-time summary of the process.
    • Monitoring: Use this section to identify crawl errors and troubleshoot issues affecting search results.
    • Suggestions: Provides actionable feedback after each crawl, including recommendations for fixing redirects/domain issues, addressing ignored or failed URLs, and adding missing sitemaps.
  9. Enable DocSearch for documentation website generators

    DocSearch (Legacy v1.x - v2.x) provides direct integrations for several documentation website generators. If you are using one of the following tools, refer to their specific documentation to enable DocSearch on your website:

  10. Access DocSearch implementation code and API keys

    v3

    The DocSearch tab in the Algolia Crawler Visual UI (Legacy v3.x) provides the necessary assets to integrate DocSearch into your frontend. It contains:

    • Implementation code: Ready-to-use code snippets for frontend integration.
    • API keys: Your unique Application ID and Search API Key required to connect your site to your Algolia index.
    • Quick links: Access to record reviews, documentation, and support.
  11. Crawling mechanisms in DocSearch Legacy (v1.x - v2.x)

    In DocSearch Legacy, the crawler discovers pages using two primary methods:

    1. Recursive Crawling: The crawler starts at the URLs defined in the start_urls configuration value. It reads those pages and recursively follows every link found until all compliant pages have been browsed.
    2. Sitemap Scraping: If a sitemap.xml is explicitly defined in the configuration, the crawler will scrape every provided and compliant URL in the sitemap. Using a sitemap is recommended to ensure all pages are discovered, even those not linked internally.
  12. Architecture of DocSearch (v3.x)

    v3

    DocSearch (Legacy v3.x) consists of two main components:

    1. Crawler: Managed by the Algolia Crawler. It is scheduled to run once a week by default, though crawls can be triggered manually. Configuration and monitoring are handled via the Crawler interface.
    2. Frontend Library: Built on top of Algolia Autocomplete, providing a search experience via a modal interface.