The searchd daemon of sphtracing supports MySQL binary network protocol from version 0.9.9-rc2 and can be accessed through standard MySQL APIs.
For example, the "mysql" command line program can work well.
The following is an example of using the MySQL client to query Sphinx:
Copy codeThe Code is as follows: $ mysql-P 9306
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 1
Server version: 0.9.9-dev (r1734)
Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.
Mysql> SELECT * FROM test1 where match ('test ')
-> Order by group_id asc option ranker = bm25;
+ ------ + -------- + ---------- + ------------ +
| Id | weight | group_id | date_added |
+ ------ + -------- + ---------- + ------------ +
| 4 | 1442 | 2 | 1231721236 |
| 2 | 2421 | 123 | 1231721236 |
| 1 | 2421 | 456 | 1231721236 |
+ ------ + -------- + ---------- + ------------ +
3 rows in set (0.00 sec)
Enabling method:
You only need to change the configuration file by adding a listener protocol of mysql41:
Listen = localhost: 9306: mysql41
Sphinx also supports a small subset of SQL. We give this subset A nickname called SphinxQL.
It only supports some syntaxes. For example, count (*) is not supported. For more information about the number of results to be summarized, see: How does sphinxql obtain the number of results? What are the detailed descriptions of show meta? "& (And) Operations" and so on are not supported.
For more information, see: http://sphinxsearch.com/docs/1.10/sphinxql-reference.html