这些断言使用了编程距离方法来决定文本片段是否与查找的模式足够的近。这是基于评估样式中有多少个字符需要变更才可以与被检查的文本匹配。例如pall可以也palm,paul,palm匹配。
These predicates use the Levenshtein distance method to decide if a piece of text is close enough to
the pattern being looked for. This is based on assessing how many characterss would have to
change in the pattern word to achieve a match in the text being inspected. For example pall would
match palm, paul and palm.
下面的查询使用了fuzzy样式来找到任何与单词pall相近的单词。
The query below uses a fuzzy sort to find any words that are close to the word pall.
这是运行查询返回的结果。您可以看到机场的描述包含了完整的单词Paul, Palm 和 Hall ,它们已被找到了。
Here are the results from running the query. You can see that airport descriptions that contain the
whole words Paul, Palm and Hall have been found.
这个查询使用了textFuzzy来找到城市,它们的名字与Dublin相近。
This query uses textFuzzy to find cities whose names are close to Dublin.
这是查询返回的。您可以看到,模糊搜索使用的方法不是单个字符的代替。注意返回的城市的名字它们的长度不全是相同的。为了更好地理解模糊搜索的算法,推荐阅读以上提到的维基页面。
Here is what the query returns. You can see that the method used by fuzzy searches is more than
just single character replacement. Note that not all of the city names returned are of the same
length. To better understand the fuzzy search algorithm it is recommended to look at the Wikipedia
page mentioned above.
浙公网安备 33010602011771号