环境:
centOS6.4-32位
msyql-5.1
coreseek 开启模糊查询,需要设置2个参数
min_infix_len = 1
enable_star = 1
数据库表
| 8 | test | linux |
| 9 | test | linux |
| 10 | test | linux |
| 11 | test | linux |
| 12 | M K L | KS L |
| 13 | BIDU | BMFI |
| 14 | BIDU | BMFI |
| 15 | BIDU 1 | BMFI 1 |
| 16 | BIDU | BMFI |
| 17 | BIasfdsf | BMFI |
| 18 | BI1111 | BMFI |
+----+---------------+-----------------------------+
[root@localhost coreseek]# bin/search 'b*'
displaying matches:
1. document=13, weight=2
id=13
title=BIDU
content=BMFI
2. document=14, weight=2
id=14
title=BIDU
content=BMFI
3. document=15, weight=2
id=15
title=BIDU 1
content=BMFI 1
4. document=16, weight=2
id=16
title=BIDU
content=BMFI
5. document=17, weight=2
id=17
title=BIasfdsf
content=BMFI
6. document=18, weight=2
id=18
title=BI1111
content=BMFI
7. document=19, weight=2
id=19
title=BI2222
content=BMFI
words:
1. 'b*': 7 documents, 14 hits
使用场景:
根据用户输入的字符实时匹配
example:
输入 b
匹配出所有包含b 的股票代码