See this bug report for more info.
Copy / paste from sphinxsearch/sphinx
Add the following to the require
section of your composer.json file:
"sphinx/client": "dev-master"
Search test word in Sphinx for example_idx index.
use Sphinx\Client;
$sphinx = new Client();
$sphinx->setServer('localhost', 6712);
$sphinx->setMatchMode(Client::MATCH_ANY);
$sphinx->setMaxQueryTime(3);
$result = $sphinx->query('test', 'example_idx');
var_dump($result);
Printed result:
array(10) {
["error"]=>
string(0) ""
["warning"]=>
string(0) ""
["status"]=>
int(0)
["fields"]=>
array(3) {
[0]=>
string(7) "subject"
[1]=>
string(4) "body"
[2]=>
string(6) "author"
}
["attrs"]=>
array(0) {
}
["matches"]=>
array(1) {
[3]=>
array(2) {
["weight"]=>
int(1)
["attrs"]=>
array(0) {
}
}
}
["total"]=>
int(1)
["total_found"]=>
int(1)
["time"]=>
float(0)
["words"]=>
array(1) {
["to"]=>
array(2) {
["docs"]=>
int(1)
["hits"]=>
int(1)
}
}
}
This bundle is under the GPL-3.0 license. See the complete license in the file: LICENSE