polysource / search
Polysource — global cross-resource search with Cmd+K palette UI.
Package info
Type:symfony-bundle
pkg:composer/polysource/search
v0.1.1
2026-05-10 21:00 UTC
Requires
- php: >=8.1
- polysource/core: ^0.1
- symfony/config: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/http-kernel: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/translation: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0 || ^8.0
- twig/twig: ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5
This package is auto-updated.
Last update: 2026-05-10 21:01:31 UTC
README
Cross-resource search palette (Cmd+K / Ctrl+K / "/") for Polysource — Linear / Notion-style fastest-path navigation.
Part of the Polysource monorepo. MIT-licensed.
What it ships
SearchResultVO +SearchProviderInterface(3 methods: id / label / search with deadline contract).SearchAggregator— fan-out across tagged providers with 3 contention layers:- per-provider limit
- total budget 250 ms
- try/catch isolation per provider
ResourceSearchProvider— default impl wrapping any Polysource Resource viaDataSource::search().SearchController— JSON endpointGET /admin/search?q=….SearchExtensionTwig (polysource_search_palette()).- Stimulus
cmdk_controller.js— Cmd+K / Ctrl+K / "/" hooks, debounce 150 ms, arrow-keys + Enter nav, Esc close, results grouped per resource. - Accessible overlay template
_palette.html.twig.
See ADR-023. Future bridges (search-meilisearch, search-algolia, search-elasticsearch) extend via SearchProviderInterface.
Extend it
SearchProviderInterface is 3 methods (getId / getLabel / search). To plug Algolia, Elasticsearch, your custom service into the Cmd+K palette:
#[AutoconfigureTag('polysource.search.provider')] final class AlgoliaSearchProvider implements SearchProviderInterface { public function getId(): string { return 'algolia:products'; } public function getLabel(): string { return 'Products (Algolia)'; } public function search(string $query, int $limit, float $deadline): array { // Respect the deadline; the aggregator enforces a 250ms global budget. } }
Done. The aggregator fan-outs across every tagged provider. See extensibility map.
Install
composer require polysource/search
Register the bundle:
return [ Polysource\Search\PolysourceSearchBundle::class => ['all' => true], ];