2016-08-27 33 views
0

使用Rails 4,Thinking Sphinx 3.2.0。我最近將一列從for_search更名爲address_lookupShop型號的列爲address_lookup,我有Country,它與Shop型號相關聯。重命名列,但ThinkingSphinx :: SphinxError:未知列:'shop_address_lookup'

這裏是我的Country指數:

ThinkingSphinx::Index.define :state, with: :real_time do 
    indexes name 
    indexes shop_address_lookup 
    ... 
end 

我刪除了development.sphinx.conf,跑​​。索引Shop工作得很好,但是當它試圖指數Country,它不停地拋出了以下錯誤:

Generating index files for country_core 
rake aborted! 
ThinkingSphinx::SphinxError: unknown column: 'shop_address_lookup' - REPLACE INTO country_core (id, `sphinx_internal_class_name`, `name`, `country_status`, `shop_address_lookup` 
... 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `load' 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>' 
Innertube::Pool::BadResource: Innertube::Pool::BadResource 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `load' 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>' 
ThinkingSphinx::QueryExecutionError: unknown column: 'shop_address_lookup' 
... 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `load' 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>' 
Mysql2::Error: unknown column: 'shop_address_lookup' 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `load' 
/Users/abc/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>' 
Tasks: TOP => ts:regenerate => ts:generate 
(See full trace by running task with --trace) 

我只是改名爲列,並且已經更新了我的索引文件。我能做些什麼來解決這個問題?

注意:當我重新將索引從shop_address_lookup重命名爲shop_for_search而不更改實際列名稱時,索引正常工作。

回答

0

管理得到這個最後的工作 - 刪除db/sphinx/development/*運行之前rake ts:regenerate

自我提醒:

[email protected] ~/Sites/xyz (master●●)$ rake ts:regenerate 
Stopped searchd daemon (pid: 65211). 
Generating configuration to /Users/abc/Sites/xyz/config/development.sphinx.conf 
Failed to start searchd daemon. Check /Users/abc/Sites/xyz/log/development.searchd.log. 
Failed to start searchd. Check the log files for more information. 
Generating index files for spot_core 
^C%                                                          [email protected] ~/Sites/xyz (master●●)$ ps aux | grep searcd 
abc  65649 0.0 0.0 2423380 300 s001 R+ 2:10AM 0:00.00 grep --color=auto searcd 
[email protected] ~/Sites/xyz (master●●)$ ps aux | grep searchd 
abc  65727 0.0 0.0 2435864 788 s001 R+ 2:10AM 0:00.00 grep --color=auto searchd 
========== REMOVE db/sphinx/development/* at this step ============ 
[email protected] ~/Sites/xyz (master●●)$ rake ts:regenerate 
searchd is not currently running. 
Stopped searchd daemon (pid:). 
Generating configuration to /Users/abc/Sites/xyz/config/development.sphinx.conf 
Started searchd successfully (pid: 65936). 
Generating index files for shop_core 
.......................... 
Generating index files for trip_core 
........