PHP code example of roelofjan-elsinga / solarium-luke

1. Go to this page and download the library: Download roelofjan-elsinga/solarium-luke 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/ */

    

roelofjan-elsinga / solarium-luke example snippets


use Solarium\Client;
use Solarium\QueryType\Luke\Query;

$client = new Client();
$client->registerQueryType(Query::QUERY_LUKE, Query::class);
$luke = $client->createQuery(Query::QUERY_LUKE);
$data = $client->execute($luke);

print 'Top terms: ';
var_dump($data->getTopTerms());
print PHP_EOL;