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

Python 如何使Zope TextIndex返回类似的文档?,python,zope,Python,Zope,使用zope的TextIndex,如何在索引中搜索与搜索字符串类似的文档,但搜索字符串的标记不全部在目标文档中 >>> from zope.index.text.textindex import TextIndex >>> index = TextIndex() >>> index.index_doc(1, "silver pearl splitter") >>> index.apply("pearl silver") #

使用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”?

我找到了一种方法

index.apply(" OR ".join("silver pearl splayer").split())