我已经测试过:
并被this one之类的“模糊通配符”搜索,仍然找不到答案。
我的问题是:输入一行字符串,如何从数据库中找到最匹配的记录?
必须满足的要求:
于2019-11-20更新比较规则:
a b c d e 1 2 3 4 5 <-- index doc
a b c d e 1 2 3 4 5 <-- search
1 1 1 1 1 1 1 1 1 1 <--- match,the same
a b c d e 1 2 3 4 5 g <-- search
1 1 1 1 1 1 1 1 1 1 0 <--- mismatch of the any longer
a b c <-- search
1 1 1 <-- match, left substring
b c d e 1 <-- search
1 1 1 1 1 <-- match, any position substring
e 1 2 3 4 5 <-- search
1 1 1 1 1 1 <-- match, right substring
e 1 0 3 4 <-- search input
1 1 0 1 1 <-- match, fuzzy <20%
e 1 2 a 4 <-- search input
1 1 1 0 1 <-- match, fuzzy <=20%
e 1 b a 4 <-- search input
1 1 0 0 1 <-- mismatch, fuzzy >20%
a 0 d e 1 2 3 4 <-- search
0 0 1 1 1 1 1 1 <--- mismatch, fuzzy >20%,
but important:" Align Left " or " right ", is based on matching up to decide