我已经运行 rake ts:config
来为 Sphinx 生成配置文件。
但是,当我尝试运行 rake ts:index
来创建索引时,我遇到了一堆这样的错误:
indexing index 'activity_core'...
ERROR: source 'activity_core_0': unknown type 'mysql'; skipping.
ERROR: index 'activity_core': failed to configure some of the sources, will not index.
我安装并运行了适用于 osx10.9 (x86_64) 的 mysql Ver 14.14 Distrib 5.6.19。
当我运行 which indexer
时,它返回 /usr/local/bin/indexer
如果我被误导了,我深表歉意。我对 Sphinx 或索引没有太多经验。如果您需要更多信息,请发表评论。
最佳答案
看起来您的 Sphinx 版本是在没有 MySQL 支持的情况下编译的。你是如何安装 Sphinx 的?您是否在 MySQL 之前安装了 Sphinx?无论哪种方式,都值得重新安装 Sphinx。
对于那些在 OS X 上使用 Homebrew 的人来说,这样做是这样的:
brew install sphinx --mysql
同样值得注意的是,Thinking Sphinx 要求 Sphinx 编译时支持 MySQL,即使您在数据库中使用 PostgreSQL(因为 MySQL 协议(protocol)用于与 Sphinx 守护进程通信)。
关于mysql - 为什么我不能使用 Thinking Sphinx 建立索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24634650/