PHP code example of polysource / search

1. Go to this page and download the library: Download polysource/search library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

polysource / search example snippets


#[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.
    }
}

return [
    Polysource\Search\PolysourceSearchBundle::class => ['all' => true],
];