Skip to content

About

A Starlight plugin that adds DocSearch powered by Typesense for fast, typo-tolerant documentation search.

Topics

Resources

Stars

12 stars

Watchers

1 watching

Forks

Repository files navigation

Starlight DocSearch Typesense 🌟🔎⚡️

A Starlight plugin that integrates Typesense with the DocSearch interface to add lightning-fast, typo-tolerant search to your Starlight documentation site.

Plugin demo

About Typesense & Starlight

Typesense is an open-source, lightning-fast search engine that delivers instant, typo-tolerant results with minimal setup. It's an open source alternative to Algolia and an easier-to-use alternative to ElasticSearch.

Starlight is a documentation framework built on Astro, focused on performance, accessibility, and customization. It helps developers create elegant, content-rich documentation sites with ease.

Together, Typesense, Starlight and DocSearch provide a seamless way to add powerful, blazingly-fast search to modern documentation websites.

Indexing Your Documentation

To power the search experience, you'll need to index your site's content into Typesense. There are two ways to do it:

  • Built-in indexing: set the plugin's indexing option and your site is indexed at the end of astro build, with one collection per language. No crawler to run or configure.
  • typesense-docsearch-scraper: a crawler that scans your deployed documentation pages, extracts structured content (like titles, headings, and paragraphs), and uploads it into your Typesense collection. Enable filterByLanguage on multilingual sites to only show results in the current language.

Development

This repository uses Bun workspaces: the plugin lives in packages/starlight-typesense and its documentation site in docs.

bun install
bun run typesense:start   # start a local Typesense server with Docker (API key: xyz)
bun run dev               # start the docs site
bun run typecheck
bun run test              # unit tests
bun run test:integration  # integration tests, requires the local Typesense server

Releasing

  1. Run bun run changeset to describe your changes, and commit the generated file.
  2. Run bun run bump to update the package version and changelog from the changesets, then commit and merge.
  3. Create a GitHub release tagged v<version> (e.g. v2.0.0). The publish workflow publishes the package to npm with trusted publishing and provenance.

Getting Started

Check out the Getting Started Guide to add Typesense search to your Starlight site quickly.

License

Licensed under the Apache License 2.0, Copyright © Typesense.

See LICENSE for more information.

About

A Starlight plugin that adds DocSearch powered by Typesense for fast, typo-tolerant documentation search.

Topics

Resources

Stars

12 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages