Read from the package's own PHP files at the commit fa612a42da97: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
MappingclassAn index's metadata as glitchr/typesense-bundle describes a collection: the very array an entry of its `typesense.mappings` is once its configuration tree has filled the defaults - so the bundle makes the same TypesenseMetadata, the same schema and the same documents as if its configuration had declared the collection.
2 methods · 3 constants
TypesenseDriverclassOmnisearch's driver for Typesense, over glitchr/typesense-bundle: an index is one of the bundle's collections (its discriminator sub-collections with it), an object becomes its document by the bundle's transformer, a Request the bundle's Query, the bundle's Response a Response. Nothing of the bundle is written again here.
15 methods
TypesenseDriverFactoryclassThe "typesense" engine. Two ways:
3 methods
Omnisearch\Typesense\Bridge\Symfony
TypesenseHostclassIn a Symfony application with glitchr/typesense-bundle, the indexes a "typesense" connection's classes declare by omnisearch's attributes become the bundle's mappings, prepended to its configuration: the bundle creates the collections (typesense:create), indexes them on Doctrine's events and imports them (typesense:action, typesense:update), exactly as for those its configuration declares; omnisearch searches through it.
2 methods
Omnisearch\Typesense
Mapping class
final class Mapping Mapping.php:23
An index's metadata as glitchr/typesense-bundle describes a collection:
the very array an entry of its typesense.mappings is once its
configuration tree has filled the defaults - so the bundle makes the
same TypesenseMetadata, the same schema and the same documents as if its
configuration had declared the collection.
Omnisearch's types become Typesense's (int: int32, bigint: int64, the lists alike; datetime stays the bundle's datetime, a timestamp in int64). A field's sort, optional and locale, and its options under "typesense" (or flat), are the bundle's field options, sent with the schema; the index's options are the collection's default_sorting_field, token_separators and symbols_to_index.
const TYPES = [Type::STRING => 'string', Type::STRINGS => 'string[]', Type::INT => 'int32', Type::INTS => 'int32[]', Type::BIGINT => 'int64', Type::FLOAT => 'float', Type:…const TOKEN_SEPARATORS = ['+', '-', '@', '.', ' ']The bundle's defaults (its configuration tree's).
const SYMBOLS_TO_INDEX = ['+']
Mapping::toTypesense()
public static function toTypesense(ClassMetadata $metadata, string $connection = 'default'): array$connectionthe bundle's connection the collection lives on
Mapping::field()
public static function field(FieldMetadata $field): arrayTypesenseDriver class
final class TypesenseDriver implements Driver TypesenseDriver.php:44
Omnisearch's driver for Typesense, over glitchr/typesense-bundle: an index is one of the bundle's collections (its discriminator sub-collections with it), an object becomes its document by the bundle's transformer, a Request the bundle's Query, the bundle's Response a Response. Nothing of the bundle is written again here.
In a Symfony application with the bundle, the collections are the bundle's own (TypesenseHost declared them); elsewhere they are made here on first use from the metadata.
A server that cannot be reached is caught by the PSR-18 interfaces (Psr\Http\Client\ClientExceptionInterface), whatever client php-http's discovery gave typesense-php: Symfony's Psr18Client throws its Psr18NetworkException, which the bundle (catching HTTPlug's exception) lets through. A search then answers a failed Response (503), a write throws a DriverException (503).
TypesenseDriver::__construct()
public function __construct(readonly TypesenseManager $manager, readonly string $connection, readonly ?TransformerInterface $transformer = null, readonly string $prefix = '')TypesenseDriver::manager()
public function manager(): TypesenseManagerTypesenseDriver::collection()
public function collection(ClassMetadata $metadata): TypesenseCollectionThe bundle's collection of an index, made and registered when the bundle has none.
- Throws
InvalidConfigException when the bundle has none and this driver no transformer to make it
TypesenseDriver::collections()
public function collections(ClassMetadata $metadata): array- Returns
the index's collection and its sub-collections, by name
TypesenseDriver::create()
public function create(ClassMetadata $metadata): voidTypesenseDriver::drop()
public function drop(ClassMetadata $metadata): voidTypesenseDriver::schema()
public function schema(ClassMetadata $metadata): arrayTypesenseDriver::schemas()
public function schemas(ClassMetadata $metadata): array- Returns
the schemas of the index's collection and sub-collections, by name on the server
TypesenseDriver::schemaOf()
public static function schemaOf(TypesenseCollection $collection): arrayWhat TypesenseCollection::create() sends.
TypesenseDriver::index()
public function index(ClassMetadata $metadata, object ...$objects): voidTypesenseDriver::remove()
public function remove(ClassMetadata $metadata, string ...$ids): voidTypesenseDriver::search()
public function search(ClassMetadata $metadata, Request $request): ResponseTypesenseDriver::query()
public static function query(ClassMetadata $metadata, Request $request): QueryA Request as the bundle's Query.
TypesenseDriver::filter()
public static function filter(Filter $filter): stringA Filter in Typesense's filter_by syntax.
TypesenseDriver::response()
public static function response(TypesenseResponse $response): ResponseThe bundle's Response as a Response.
TypesenseDriverFactory class
final class TypesenseDriverFactory implements DriverFactory TypesenseDriverFactory.php:25
The "typesense" engine. Two ways:
- over the bundle's manager (a Symfony application with
glitchr/typesense-bundle: autowired), the connection named by the
connectionoption (default "default"), its collections the bundle's; - on its own, from the options
url(or scheme, host, port),secret,prefix(put in front of every collection's name on the server) andoptions(the client's): a manager of its own, the collections made from the metadata, documents made by the bundle's transformer on Doctrine's $objectManager.
TypesenseDriverFactory::__construct()
public function __construct(readonly ?TypesenseManager $manager = null, readonly ?ObjectManager $objectManager = null)TypesenseDriverFactory::name()
public function name(): stringTypesenseDriverFactory::create()
public function create(array $options): DriverOmnisearch\Typesense\Bridge\Symfony
TypesenseHost class
final class TypesenseHost implements Host TypesenseHost.php:18
In a Symfony application with glitchr/typesense-bundle, the indexes a "typesense" connection's classes declare by omnisearch's attributes become the bundle's mappings, prepended to its configuration: the bundle creates the collections (typesense:create), indexes them on Doctrine's events and imports them (typesense:action, typesense:update), exactly as for those its configuration declares; omnisearch searches through it.
TypesenseHost::hosts()
public static function hosts(ContainerBuilder $builder): boolTypesenseHost::prepend()
public static function prepend(ContainerBuilder $builder, string $connection, array $options, array $metadata): void