草庐IT

FuzzyTerm

全部标签

python - 在 Python 中使用 Whoosh 进行模糊字符串搜索

我在MongoDB中建立了一个大型银行数据库。我可以很容易地获取这些信息并快速创建索引。例如,我希望能够匹配银行名称“EagleBank&TrustCoofMissouri”和“EagleBankandTrustCompanyofMissouri”。以下代码适用于简单的模糊此类,但无法实现上述匹配:fromwhoosh.indeximportcreate_infromwhoosh.fieldsimport*schema=Schema(name=TEXT(stored=True))ix=create_in("indexdir",schema)writer=ix.writer()test_