Djangosphinx:SphinxClient实例没有属性“SetFieldWeights”

2024-06-01 07:45:47 发布

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

在我的模型中,当我提到SphinxSearch时,默认值如下:

from djangosphinx.models import SphinxSearch

class Blog(models.Model):
    ...
    search = SphinxSearh()

全文搜索效果很好。但当我给出weights属性时:

^{pr2}$

搜索增加:SphinxClient instance has no attribute 'SetFieldWeights'

我一定是错过了一些显而易见的东西,因为我似乎是唯一一个在谷歌搜索后有这个问题的人。任何帮助都是非常感谢的。在


Tags: from模型importsearchmodel属性modelsblog
1条回答
网友
1楼 · 发布于 2024-06-01 07:45:47

这个问题是由于sphinxapi的版本,put

SPHINX_API_VERSION = 0x116

在你的设置.py文件。问题会得到解决的。在

获取的默认版本是0x107,它没有实现“SetFieldWeights”函数。在

相关问题 更多 >