我的索引配置:
index my_index
{
# ...
type = rt
phrase_boundary = ., ?, U+2026
charset_table = 0..9, english, russian, _
dict = keywords
min_word_len = 1
min_infix_len = 1
preopen = 1
rt_field = title
infix_fields = title
}
我正在使用 sphinxsearch 2.2.7。我正在尝试使用下一个查询进行搜索:
mysql> select COUNT(*) from my_index WHERE match('*cc*');
+----------+
| count(*) |
+----------+
| 63 |
+----------+
1 row in set (0.00 sec)
它运作良好。
但是,如果我尝试按一个字符搜索,它不会给出任何结果:
mysql> select COUNT(*) from my_index WHERE match('*c*');
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
我用基于 mysql-datasource 的索引尝试了相同的配置,得到了相同的结果。是的,我在重新配置后确实重新索引了很多次。它是狮身人面像中的错误吗?
编辑: 显示元;及展示计划;结果:
mysql> select COUNT(*) from my_index WHERE match('*cc*');
+----------+
| count(*) |
+----------+
| 63 |
+----------+
1 row in set (0.00 sec)
mysql> SHOW PLAN;
+------------------+------------------------------------------+
| Variable | Value |
+------------------+------------------------------------------+
| transformed_tree | AND(KEYWORD(*cc*, querypos=1, expanded)) |
+------------------+------------------------------------------+
1 row in set (0.00 sec)
mysql> SHOW META;
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| total | 1 |
| total_found | 1 |
| time | 0.000 |
| keyword[0] | *cc* |
| docs[0] | 63 |
| hits[0] | 63 |
+---------------+-------+
6 rows in set (0.00 sec)
mysql> select COUNT(*) from my_index WHERE match('*c*');
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql> SHOW PLAN;
+------------------+-----------------------------------------+
| Variable | Value |
+------------------+-----------------------------------------+
| transformed_tree | AND(KEYWORD(*c*, querypos=1, expanded)) |
+------------------+-----------------------------------------+
1 row in set (0.00 sec)
mysql> SHOW META;
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| total | 0 |
| total_found | 0 |
| time | 0.000 |
| keyword[0] | *c* |
| docs[0] | 0 |
| hits[0] | 0 |
+---------------+-------+
6 rows in set (0.00 sec)