您好,欢迎访问一九零五行业门户网

Sphinx/MySQL 协议支持与SphinxQL应用实例_MySQL

bitscn.com
sphinx的searchd守护程序从版本0.9.9-rc2开始支持mysql二进制网络协议,并且能够通过标准的mysql api访问。
例如,“mysql”命令行程序可以很好地工作。
以下是用mysql客户端对sphinx进行查询的例子:
$ 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)
开启方法:
只需要更动一行配置文件,加入一个协议为mysql41的listener即可:
listen = localhost:9306:mysql41
sphinx还支持sql的一个很小的子集,我们给这个子集起个绰号,叫sphinxql。
它只支持部分语法:如:count(*)是不支持的,如需查找总结果数参考:sphinxql如何得到结果数?show meta的详细说明?不支持“&(与)操作”等。
更多内容使用请参考:http://sphinxsearch.com/docs/1.10/sphinxql-reference.html
bitscn.com
其它类似信息

推荐信息