Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 Whoosh 获得文档的相似性度量?
我想创建一个“相关”功能,对与文档具有高度相似性的其他先前索引的文档进行排名。
我是否将文档输入为长查询字符串?我是否将文档添加到索引并从那里以某种方式提取相似性查询结果?
谢谢
Whoosh 搜索器类有一个名为'more_like()'的方法。
它允许您将索引文档与其他索引文档进行比较和索引,并返回与给定文档相似的文档列表。
类 whoosh.searching.Hit可以给出排名和分数。