我想在我的项目中使用 sphinx。我想使用 RT 索引和 sphinxQL。但是我不能使用通配符查询。有人有建议吗?
这是我的 sphinx.conf : 索引测试
{
type = rt
path = /usr/local/sphinx/var/data/testrt
charset_type = utf-8
min_infix_len = 1
enable_star = 1
rt_field = name
rt_attr_string = game
INSERT:
insert into testrt values(1,'sphinx','sphinx');
查询正常,1 行受影响(0.02 秒)
mysql> select * from testrt;
+------+--------+--------+ |编号 |重量 |游戏 | +------+--------+--------+ | 1 | 1 | sphinx | +------+--------+--------+ 一组中的 1 行(0.01 秒)
mysql> select * from testrt where match('sphinx');
+------+--------+--------+ |编号 |重量 |游戏 | +------+--------+--------+ | 1 | 1500 | sphinx | +------+--------+--------+ 一组中的 1 行(0.00 秒)
mysql> select * from testrt where match('sphin*');
空集(0.00 秒)
mysql> select * from testrt where match('sphin\\*');
空集(0.02 秒)
希望你能帮我一个忙。谢谢!
最佳答案
需要 dict=keywords 前缀匹配才能在 rt 索引上工作。
http://sphinxsearch.com/docs/2.0.4/conf-dict.html
请注意,目前仅支持前缀搜索,中缀在 rt 索引上不起作用
关于java - SphinxQL 通配符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11082261/