我的想法是实现类似于MySQL MATCH/AGAINST关键字的执行。
您知道计算文本搜索相关性得分的 Python 库吗?
如果答案不令人满意,我将使用 Python 连接器连接到 MySQL。
最佳答案
看看 PyLucene http://lucene.apache.org/pylucene/
import os, sys, unittest, lucene
lucene.initVM()
baseDir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(baseDir)
import lia.searching.ScoreTest
from lucene import System
System.setProperty("index.dir", os.path.join(baseDir, 'index'))
unittest.main(lia.searching.ScoreTest)
您可以在 http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/LuceneInAction/ 找到更多示例和 lia
关于Python - 计算文本搜索相关性分数的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3392303/