PHP code example of eliasfernandez / phphinder

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

    

eliasfernandez / phphinder example snippets


use PHPhinder\Index\JsonStorage;
use PHPhinder\SearchEngine;

$storage = new JsonStorage('var');
$engine = new SearchEngine($storage);

$engine->addDocument(['_id' => 1, 'title' => 'Hi', 'text' => 'Hello world!']);
$engine->flush();
$results = $engine->search('Hello');
print_r($results[1]->getDocument());