A real-time full text search solution with javascript (client side) and php (server side)
Autocomplete, search and browsing as-you-type in real-time
It's working with
Check out the demo.
Feedback appreciated
Data must be in yaml format, some samples in tests/server/data
<?php
use Symfony\Component\Console\Output\ConsoleOutput;
use GlSearchEngine\GlServerEngine;
$output = new ConsoleOutput();
$yamlFiles = [__DIR__ . "/data/web.yml", __DIR__ . "/data/web2.yml"]; //yaml files list to import in database
$dbname = __DIR__ . "/data/web.db"; //database path
$table = "web"; //prefix table name
$fieldsFullText = ['title', 'tags', 'description', 'address', 'city']; //fields list to fulltext search
$fieldsFilter = ['gps']; //fields list possibly used to filter
$engine = new GlServerEngine($dbname, $output, true);
$engine->importYaml(
$table,
$fieldsFilter,
$fieldsFullText,
$yamlFiles,
function () use ($output) { //callback function to each import
$output->write(".");
}
);
Example of php file called by javascript client.
Allow multiple requests to be sent over the same TCP connection
Header set Connection Keep-AliveLaunch from command line :
vendor\bin\phpunit
Ranking / Sorting
GNU 2
Authors : Emmanuel ROECKER & Rym BOUCHAGOUR