Skip to content

polysource/search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polysource/search

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

  • SearchResult VO + SearchProviderInterface (3 methods: id / label / search with deadline contract).
  • SearchAggregator — fan-out across tagged providers with 3 contention layers:
    1. per-provider limit
    2. total budget 250 ms
    3. try/catch isolation per provider
  • ResourceSearchProvider — default impl wrapping any Polysource Resource via DataSource::search().
  • SearchController — JSON endpoint GET /admin/search?q=….
  • SearchExtension Twig (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

About

Polysource — global cross-resource search with Cmd+K palette UI.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors