我想用Sphinx搜索这样的案例:
tags
表:
id text
1 samsung
2 nokia
3 lg
4 lg.com
5 lg.com.uk
...
如果查询是:
I like lg
- >匹配记录3
I like lg.com
- >匹配记录4
I like samsung and lg
- >匹配记录1
和3
这个想法是查询应该包含列text
作为其子字符串。它类似于SQL中的LIKE
运算符,但与查询和列的顺序相反:
select * from tags where 'I like samsung and lg' like concat('%', text, '%')
我怎样才能在Sphinx中做到这一点? 谢谢。