statamic-rad-pack/typesense
typesense search driver for Statamic
18,973
7
| Install | |
|---|---|
composer require statamic-rad-pack/typesense |
|
| Latest Version: | v3.3.1 |
| PHP: | ^8.2 |
| Laravel: | 12 · 13 |
| Older releases: | 10 · 11 |
| License: | MIT |
| Last Updated: | Oct 8, 2026 |
| Links: | GitHub · Packagist |
Maintainer: jackmcdade
Statamic Typesense Driver
This addon provides a Typesense search driver for Statamic sites.
Requirements
- PHP 8.2+
- Laravel 10+
- Statamic 6
- Typesense 0.2+
Installation
composer require statamic-rad-pack/typesense
Add the following variables to your env file:
TYPESENSE_HOST=http://127.0.0.1
TYPESENSE_API_KEY=
Add the new driver to the statamic/search.php config file:
'drivers' => [
// other drivers
'typesense' => [
'client' => [
'api_key' => env('TYPESENSE_API_KEY', 'xyz'),
'nodes' => [
[
'host' => env('TYPESENSE_HOST', 'localhost'),
'port' => env('TYPESENSE_PORT', '8108'),
'path' => env('TYPESENSE_PATH', ''),
'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
],
],
'nearest_node' => [
'host' => env('TYPESENSE_HOST', 'localhost'),
'port' => env('TYPESENSE_PORT', '8108'),
'path' => env('TYPESENSE_PATH', ''),
'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
],
'connection_timeout_seconds' => env('TYPESENSE_CONNECTION_TIMEOUT_SECONDS', 2),
'healthcheck_interval_seconds' => env('TYPESENSE_HEALTHCHECK_INTERVAL_SECONDS', 30),
'num_retries' => env('TYPESENSE_NUM_RETRIES', 3),
'retry_interval_seconds' => env('TYPESENSE_RETRY_INTERVAL_SECONDS', 1),
],
],
],
You can optionally publish the config file for this package using:
php artisan vendor:publish --tag=statamic-typesense-config
Search Settings
Any additional settings you want to define per index can be included in the statamic/search.php config file. The settings will be updated when the index is created.
'articles' => [
'driver' => 'typesense',
'searchables' => ['collection:articles'],
'fields' => ['id', 'title', 'url', 'type', 'content', 'locale'],
'settings' => [
'schema' => [
/*
Pass an optional schema, see the Typesense documentation for more info:
https://typesense.org/docs/26.0/api/collections.html#with-pre-defined-schema
*/
'fields' => [
[
'name' => 'company_name',
'type' => 'string',
],
[
'name' => 'num_employees',
'type' => 'int32',
'sort' => true,
],
[
'name' => 'country',
'type' => 'string',
'facet' => true,
],
],
],
/*
Pass any of the options from https://typesense.org/docs/26.0/api/search.html#search-parameters
*/
'search_options' => [
/*
eg Specify a custom sort by order, see the Typesense documentation for more info:
https://typesense.org/docs/guide/ranking-and-relevance.html#ranking-based-on-relevance-and-popularity
*/
'sort_by' => '_text_match(buckets: 10):desc,weighted_score:desc',
],
/*
Set this to true to maintain the sort score order that Typesense returns
*/
'maintain_rankings' => false,
],
],
Related Packages
oilstone/api-typesense-integration
Integration service classes to connect garethhudson07/api resources with a Types...
4,787
0
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.3.1 | ^8.2 | ^12.0 || | MIT | |
| v3.3.0 | ^8.2 | ^12.0 || | MIT | |
| v3.2.2 | ^8.2 | ^12.0 || | MIT | |
| v3.2.1 | ^8.2 | ^12.0 || | MIT | |
| v3.2.0 | ^8.2 | ^12.0 || | MIT | |
| v3.1.0 | ^8.2 | ^12.0 || | MIT | |
| v3.0.0 | ^8.2 | ^12.0 | MIT | |
| v2.5.1 | ^8.2 | ^10.0| | MIT | |
| v2.5.0 | ^8.2 | ^12.0 || | MIT | |
| v2.4.0 | ^8.2 | ^10.0| | MIT | |
| v2.3.2 | ^8.2 | ^10.0| | MIT | |
| v2.3.1 | ^8.2 | ^10.0| | MIT | |
| v2.3.0 | ^8.2 | ^10.0| | MIT | |
| v2.2.0 | ^8.2 | ^10.0| | MIT | |
| v2.1.1 | ^8.2 | ^10.0| | MIT | |
| v2.1.0 | ^8.2 | ^10.0| | MIT | |
| v2.0.0 | ^8.2 | ^10.0| | MIT | |
| v1.4.1 | ^8.2 | ^10.0| | MIT | |
| v1.4.0 | ^8.2 | ^10.0| | MIT | |
| v1.3.1 | ^8.2 | ^10.0| | MIT | |
| v1.3.0 | ^8.2 | ^10.0| | MIT | |
| v1.2.1 | ^8.2 | ^10.0| | MIT | |
| v1.2.0 | ^8.2 | ^10.0| | MIT | |
| v1.1.0 | ^8.2 | ^10.0| | MIT | |
| v1.0.1 | ^8.2 | ^10.0| | MIT | |
| v1.0.0 | ^8.2 | ^10.0| | MIT |