schranz-search / seal-typesense-adapter
An adapter to support typesense in cmsig/seal search abstraction.
Fund package maintenance!
alexander-schranz
paypal.me/L91
Requires
- php: ^8.1
- psr/container: ^1.0 || ^2.0
- schranz-search/seal: ^0.5
- symfony/http-client: ^5.4 || ^6.0 || ^7.0
- typesense/typesense-php: ^4.8.1
Requires (Dev)
- php-cs-fixer/shim: ^3.51
- php-http/curl-client: ^2.0
- php-http/discovery: ^1.14
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^10.3
- rector/rector: ^1.0
Conflicts
- monolog/monolog: <2.0
README
Logo created by Meine WilmaNote: This is part of the
cmsig/search
project create issues in the main repository.
SEAL
Typesense Adapter
The TypesenseAdapter
write the documents into a Typesense server instance.
Note: This project is heavily under development and any feedback is greatly appreciated.
Installation
Use composer for install the package:
composer require cmsig/seal cmsig/seal-typesense-adapter
Usage.
The following code shows how to create an Engine using this Adapter:
<?php use Http\Client\Curl\Client as CurlClient; use Http\Discovery\Psr17FactoryDiscovery; use CmsIg\Seal\Adapter\Typesense\TypesenseAdapter; use CmsIg\Seal\Engine; use Typesense\Client; $client = new Client( [ 'api_key' => 'S3CR3T', 'nodes' => [ [ 'host' => '127.0.0.1', 'port' => '8108', 'protocol' => 'http', ], ], 'client' => new CurlClient(Psr17FactoryDiscovery::findResponseFactory(), Psr17FactoryDiscovery::findStreamFactory()), ] ); $engine = new Engine( new TypesenseAdapter($client), $schema, );
Via DSN for your favorite framework:
typesense://S3CR3T@127.0.0.1:8108