PHP code example of klaasie / scout-solr-engine

1. Go to this page and download the library: Download klaasie/scout-solr-engine 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/ */

    

klaasie / scout-solr-engine example snippets


$model = new \App\Models\SearchableModel();

/** @var \Scout\Solr\Engines\SolrEngine $engine */
$engine = app(\Laravel\Scout\EngineManager::class)->engine();
$select = $engine->setCore($model)->createSelect();
$select->setQuery('*:*');
$result = $engine->select($select, $engine->getEndpointFromConfig($model->searchableAs())); // getEndpointFromConfig() is only necessary when your model does not use the default solr instance.