django-sphinx:SphinxClient 实例没有属性“SetFieldWeights”;
在我的模型中,当我使用默认值引用 SphinxSearch 时,例如:
from djangosphinx.models import SphinxSearch
class Blog(models.Model):
...
search = SphinxSearh()
全文搜索工作正常。但是,当我按照记录提供 weights
属性时:
search = SphinxSearch(
weights={'title': 10, 'body': 5, 'tags': 10}
)
搜索引发:SphinxClient 实例没有属性 'SetFieldWeights'
我一定错过了一些明显的东西,因为我似乎是唯一一个拥有此属性的人谷歌搜索后出现问题。非常感谢任何帮助。
In my models, when I refer to SphinxSearch with defaults like:
from djangosphinx.models import SphinxSearch
class Blog(models.Model):
...
search = SphinxSearh()
the fulltext search works fine. But when I give weights
attribute as documented:
search = SphinxSearch(
weights={'title': 10, 'body': 5, 'tags': 10}
)
searches raise: SphinxClient instance has no attribute 'SetFieldWeights'
I must be missing something obvious as I seem to be the only one with this problem after Googling. Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题是由于sphinxapi的版本而出现的,把
settings.py 文件中的 。问题将会得到解决。
默认版本是 0x107,它没有实现“SetFieldWeights”功能。
This problem is coming due to version of sphinxapi, put
in your settings.py file. problem will get resolve.
Default version getting picked up is 0x107, which doesn't have implemented 'SetFieldWeights' function.