2.8.1.6. Sphinx test

To check the functionality Sphinx install default configuration and execute script:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
 
$search_string = '';
$index_name = 'test_index';
 
echo '<pre>';
 
$link = mysqli_init();
mysqli_real_connect($link, null, null, null, null, null, '/home/' . get_current_user() . '/.system/sphinx/sphinx.socket');
 
$result = mysqli_query($link, "select id from $index_name where match('$search_string')");
while($row = mysqli_fetch_assoc($result)) {
    echo $row['id'] . PHP_EOL;
}

If Sphinx is running, the script will output strings with numbers.

Content