sphinx / client
Sphinx API client
Installs: 56 323
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 3
Open Issues: 3
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-12-15 19:49:14 UTC
README
See this bug report for more info.
Sphinx PHP client
Copy / paste from sphinxsearch/sphinx
Installation
Add the following to the require
section of your composer.json file:
"sphinx/client": "dev-master"
Usage
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)
}
}
}
License
This bundle is under the GPL-3.0 license. See the complete license in the file: LICENSE