Repository navigation
[6.x] Add a native Typesense search driver - #15714
Open
jackmcdade wants to merge 2 commits into
Open
jackmcdade wants to merge 2 commits into
jackmcdade wants to merge 2 commits into
Conversation
Give Statamic a first-party Typesense index with alias reindexing, pushed-down filters, hybrid embeddings, scoped keys, and optional natural language search.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Typesense as a built-in search driver alongside Algolia and local search. You can run your own Typesense server or use Typesense Cloud, then use Statamic's existing search tags and query builder.
This includes the usual filtering, sorting, pagination, highlights, and snippets — plus optional semantic search and natural language queries.
Why this over the Rad Pack add-on?
The Rad Pack add-on already gets Statamic talking to Typesense. This brings that integration into core and goes further in a few useful ways:
{{ search:scoped_key }}generates an expiring search key with published-content and applicable site constraints, so you can query Typesense directly from your frontend.Existing Rad Pack
clientandsearch_optionsconfig is supported. Runphp please search:updateto rebuild an existing index using the new driver.Setup
Run the interactive installer to choose Local, Algolia, or Typesense:
php please install:search # Or select a driver and index directly: php please install:search typesense --index=blogIt installs the SDK, checks your connection, saves credentials in
.env, and updates the selected index without replacing its fields or transformers. It can also build the index for you. Semantic search and natural language setup are optional; NL setup supports an existing Typesense model or a new OpenAI model.For manual setup, Typesense requires version 30+ and
composer require typesense/typesense-php:^6.0. Add your connection details to the search driver config, then configure an index:Semantic search is configured through
settings.embedding. Typesense can run its built-in embedding model itself. Natural language search is separately opt-in through->naturalLanguage()ornatural_language="true"and needs an LLM configured on the Typesense server. Neither is implicitly enabled in the Control Panel.Testing and caveats
Search/tag tests, 16 installer tests, Pint, and PHPStan pass. Tests use mocked HTTP responses; live-server verification is still needed for rebuilds, pagination, scoped keys, and the optional AI features.
Local filtering defaults to 250 candidates. Presets that restrict returned fields must retain
referencefor result hydration. Grouped results still report group counts. The first migration from a plain collection needs a delete-and-alias step; subsequent alias rebuilds keep search available.Docs will follow in statamic/docs.