认为 Sphinx 没有为新添加的记录建立索引
我正在使用 sphinx 搜索 2 个模型及其关联。我正在使用增量索引。在我的开发盒上,在开发模式(Ubuntu)下一切正常。但是,在暂存盒生产环境中,当我创建新记录时,我需要再次构建索引以使新创建的记录可搜索。甚至奇怪的是,当我使用脚本/控制台创建记录时,它们似乎已被索引并且可以搜索。
为了使关联在更新后起作用,我为所有关联模型提供了 after_save 方法,该方法将这两个模型记录的增量设置为 true。我不确定这是否与此有关。
我检查了权限,认为 sphinx gem 版本,它们似乎都很好。可能出什么问题了?
编辑
我还查看了http:// /freelancing-god.github.com/ts/en/common_issues.html#deltas 但它似乎不起作用。是的,服务器在 phusion guest 上运行。
I am using sphinx to search on 2 models along with their associations. I am using delta indexing. Things work fine on my dev box in dev mode (Ubuntu). However, on staging box production env, when I create new records, I need to build the index again in order to make the newly created records searchable. Even weird is that when I create records using script/console, they seem to be getting indexed and are searchable.
For the associations to work after update, I have an after_save method for all the association models that set the delta of these two model records to true. I am not sure if this has anything to do with this.
I have checked for permissions, thinking sphinx gem version and they all seem to be fine. What could be wrong?
EDIT
I have also checked out http://freelancing-god.github.com/ts/en/common_issues.html#deltas but it doesn't seem to work. And yes the server runs on phusion passenger.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了类似的问题,我认为这是一个依赖解析问题。
请参阅我的帖子此处 。
不知何故,我认为 Thinking-sphinx 的更新版本是通过 gem 安装在我的机器上的,而且我仍然通过 apt-get 安装了它。我用apt清除了它,然后重新安装了它。后来,我发现表中有一个不应该使用的特殊字段::type,我编辑了迁移以删除该类型并再次将其添加为不同的名称。然后就成功了。您应该发布模型的相关代码、调用搜索的控制器操作、调用任何 rake 命令时的任何明显输出。尝试卸载 gem,然后重新安装。然后卸载apt包,然后重新安装。
I had something like this exact issue, and I think it was a dependency resolution issue.
See my post here.
Somehow, I think an updated version of thinking-sphinx got installed on my machine via a gem, and I still had it installed via apt-get. I purged it with apt, and then reinstalled it. Afterward, I found that I had a special field in a table that should not be used, :type, and I edited the migration to remove the type and add it again as a different name. Then it worked. You should post your relevant code, for the models, the controller action that calls search, any conspicuous output on calling any of the rake commands. Try uninstalling the gem and then reinstalling it. Then uninstall the apt package, and reinstall it.