dev-master
9999999-dev http://sphinxsearch.com/Sphinx API client
GPL-3.0
The Requires
- php >=5.3.0
php sphinx
Sphinx API client
See this bug report for more info., (*1)
Copy / paste from sphinxsearch/sphinx, (*3)
Add the following to the require
section of your composer.json file:, (*4)
"sphinx/client": "dev-master"
Search test word in Sphinx for example_idx index., (*5)
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:, (*6)
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, (*7)
Sphinx API client
GPL-3.0
php sphinx