如何在sphinx搜索中获得全局变量



如何在sphinx搜索中获得全局变量,我已将其自定义为

SET GLOBAL @test = (1,2,3)

显示全局变量返回

+----------------------+---------+
| Variable_name        | Value   |
+----------------------+---------+
| autocommit           | 1       |
| collation_connection | libc_ci |
| query_log_format     | plain   |
| log_level            | info    |
+----------------------+---------+
set (0.00 sec)

Sphinx文档http://sphinxsearch.com/docs/current.html#sphinxql-set有一个例子:

// in session 1
mysql> SET GLOBAL @myfilter=(2,3,5,7,11,13);
Query OK, 0 rows affected (0.00 sec)
// later in session 2
mysql> SELECT * FROM test1 WHERE group_id IN @myfilter;
+------+--------+----------+------------+-----------------+------+
| id   | weight | group_id | date_added | title           | tag  |
+------+--------+----------+------------+-----------------+------+
|    3 |      1 |        2 | 1299338153 | another doc     | 15   |
|    4 |      1 |        2 | 1299338153 | doc number four | 7,40 |
+------+--------+----------+------------+-----------------+------+
2 rows in set (0.02 sec)

这就是得到变量的方法。如何显示可变内容是另一个问题,我无法做到这一点。: -)

相关内容

  • 没有找到相关文章

最新更新