polysource/search
最新稳定版本:v0.1.2
Composer 安装命令:
composer require polysource/search
包简介
Polysource — global cross-resource search with Cmd+K palette UI.
README 文档
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], ];
Documentation
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-10