2014-04-02 61 views
0

我已經使用pgsql從源代碼安裝了Sphinx,然後在我的應用程序(Rails 4.0.3)上安裝了思維-Sphinx gem(3.0.1)。並且我配置了&生成的獅身人面像配置。然後我在app/index上添加了索引,然後運行索引&通過rake ts啓動sphinx:index & & ts:start,但是我得到了下面的錯誤,讓我知道解決這個問題的方法。無法在rails 4中啓動sphinx

耙TS:索引

產生配置於/home/stc/presto/config/development.sphinx.conf

斯芬克斯2.1.7釋放(rel21-r4638)

版權(C)2001年至2014年,Andrew Aksyonoff

Copyrigh T(C)2008-2014,獅身人面像信息技術有限公司(http://sphinxsearch.com

使用配置文件 '/home/stc/config/development.sphinx.conf' ......

FATAL:無索引在配置文件中找到'/home/stc/config/development.sphinx.conf'

耙TS:啓動

在日誌文件中,我可以看到下面的錯誤

[Wed Apr 2 10:40:49.834 2014] [14338] Child process 14339 has been forked 
[Wed Apr 2 10:40:49.835 2014] [14339] listening on 127.0.0.1:9306 
[Wed Apr 2 10:40:49.835 2014] [14339] WARNING: ERROR: index 'collection_core': RT indexes support prefixes and infixes with only dict=keywords - NOT SERVING 
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: ERROR: index 'resource_core': RT indexes support prefixes and infixes with only dict=keywords - NOT SERVING 
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'collection': no such local index 'collection_core' - SKIPPING LOCAL INDEX 
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'collection': no valid local/remote indexes in distributed index - NOT SERVING 
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'resource': no such local index 'resource_core' - SKIPPING LOCAL INDEX 
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'resource': no valid local/remote indexes in distributed index - NOT SERVING 
[Wed Apr 2 10:40:49.836 2014] [14339] FATAL: no valid indexes to serve 
[Wed Apr 2 10:40:49.836 2014] [14338] Child process 14339 has been finished, exit code 1. Watchdog finishes also. Good bye! 

回答

0

解決了這個在思考獅身人面像谷歌組,以及:

你似乎是使用實時指數 - 這是偉大的 - 但是,這意味着你不需要使用TS:指標任務。這兩個有用的主要任務是:

  • ts:generate - 它添加/更新每個實時索引中的所有文檔。
  • ts:regenerate - 停止Sphinx,清除現有的索引文件,生成配置,啓動Sphinx並運行ts:generate。

但是,您也正在使用min_infix_len或min_prefix_len - 而對於Sphinx 2.1,默認字典設置與所需內容(作爲日誌詳細信息)不匹配。因此,如果您將dict:keywords添加到config/think_sphinx.yml中的相應環境中,然後運行ts:regenerate,那麼您應該有一個可以工作的Sphinx設置。

+0

感謝它的工作像魅力 – loganathan