PHP code example of silverstripe / silverstripe-discoverer-bifrost

1. Go to this page and download the library: Download silverstripe/silverstripe-discoverer-bifrost 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/ */

    

silverstripe / silverstripe-discoverer-bifrost example snippets


$service = SearchService::create();

$query = Query::create('lorem ipsum');

// $results will be a Result object, a class provided by the Discoverer module
$results = $service->search($query, '<suffix>');
// Debug results
Debug::dump($results);

foreach ($results->getRecords() as $record) {
    Debug::dump($record->Title);
    Debug::dump($record->Content);
}