Sphinx搜索,数字关键字的部分搜索?
我目前正在测试 sphinx,所以我仍在阅读并掌握术语和用法。
Sphinx 2.0.1-id64-beta (r2792)
我已将 sphinx 设置为使用
morphology = stem_en
min_stemming_len = 2
min_word_len = 3
min_infix_len = 2
enable_star = 1
简化数据集
---------------------------------------------
| id | searchdata |
| 1 | lots of text 00AA0000 00AA4500 AA01 |
| 2 | lots of text 01AA1000 00AA3400 AA21 |
| 3 | lots of text 10AA3000 00AA2300 AA41 |
| 4 | lots of text 02AA4050 00AA1000 AA50 |
---------------------------------------------
我尝试执行的查询如下
SELECT * FROM jobs WHERE MATCH('*AA0*')
对于上述查询没有返回结果。
SELECT * FROM jobs WHERE MATCH('*00AA0*')
虽然上面的查询返回了结果。
我是否需要添加自定义关键字列表,例如:“00AA000”,我该怎么做?
我将不胜感激任何帮助。 问候 达克斯
I'm currently testing sphinx, So I'm still reading up and getting to grips with the terminology and usage.
Sphinx 2.0.1-id64-beta (r2792)
I've setup sphinx to use
morphology = stem_en
min_stemming_len = 2
min_word_len = 3
min_infix_len = 2
enable_star = 1
Simplified data set
---------------------------------------------
| id | searchdata |
| 1 | lots of text 00AA0000 00AA4500 AA01 |
| 2 | lots of text 01AA1000 00AA3400 AA21 |
| 3 | lots of text 10AA3000 00AA2300 AA41 |
| 4 | lots of text 02AA4050 00AA1000 AA50 |
---------------------------------------------
The query I am trying to perform is as follows
SELECT * FROM jobs WHERE MATCH('*AA0*')
There are no results returned for the above query.
SELECT * FROM jobs WHERE MATCH('*00AA0*')
Tho there are results returned for the above query.
Do I need to add a list of custom keywords eg: "00AA000", How would I do that?
I'd appreciate any help.
Regards
dax
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不建议在同一索引上使用词干和中缀。不会很好地工作。
尝试删除词干。
I would not recommend using stemming and infix on the same index. Not going to work well.
Try removing stemming.