1

我在我的 ubuntu 12.04 中安装 Thinking sphinx 时遇到问题。

每当我运行 rake ts:index 时,我都会得到以下信息。

Generating configuration to /home/tom/digmenu/config/development.sphinx.conf
Sphinx 2.0.6-id64-release (r3473)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/home/tom/digmenu/config/development.sphinx.conf'...
FATAL: no indexes found in config file '/home/tom/digmenu/config/development.sphinx.conf'
Generating configuration to /home/tom/digmenu/config/development.sphinx.conf
Sphinx 2.0.6-id64-release (r3473)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/home/tom/digmenu/config/development.sphinx.conf'...
FATAL: no indexes found in config file '/home/tom/digmenu/config/development.sphinx.conf'

模型.rb

define_index 做索引 :name, as : :re_name end

狮身人面像的配置文件

indexer
{
}

searchd
{
  listen = 127.0.0.1:9306:mysql41
  log = /home/tom/digmenu/log/development.searchd.log
  query_log = /home/tom/digmenu/log/development.searchd.query.log
  pid_file = /home/tom/digmenu/log/development.sphinx.pid
  workers = threads
  binlog_path = /home/tom/digmenu/tmp/binlog/development
}

我完全不知道为什么这不起作用!配置在索引期间生成但退出。

有人知道吗?

4

1 回答 1

4

你可能已经解决了你的问题,但无论如何。也许它会帮助别人。

出现此问题的原因是您可能正在使用 Thinking Sphinx 3.0 或更高版本,但以旧方式定义索引,就像在 Thinking Sphinx 2.* 和更早版本中所做的那样。索引定义不再在模型本身中,而是在单独的文件中,这些文件放在app/indices. 还有许多其他更改,因此最好仔细阅读新文档。

3.0 的文档在 README 文件中:https ://github.com/pat/thinking-sphinx/

“官方”文档仍然是指旧版本,其工作方式不同: http: //pat.github.com/ts/en/

于 2013-03-22T15:36:34.653 回答