如何使Zope TextIndex返回类似的文档?

2024-06-16 14:10:39 发布

您现在位置:Python中文网/ 问答频道 /正文

使用zope的TextIndex,如何在索引中搜索与搜索字符串类似的文档,但搜索字符串的标记不全部在目标文档中

>>> from zope.index.text.textindex import TextIndex
>>> index = TextIndex()
>>> index.index_doc(1, "silver pearl splitter")
>>> index.apply("pearl silver") # this works
BTrees.IFBTree.IFBucket([(1, 0.8164966106414795)])
>>> index.apply("silver pearl splayer") # this doesn't
BTrees.IFBTree.IFBucket([])

如果我搜索“silver pearl splayer”,有没有一种让索引找到“silver pearl splitter”的简单方法


Tags: 字符串文档标记zopeindexsilverthisapply