2016-08-27 2 views
0

Rails 4를 사용하여 생각하는 스핑크스 3.2.0. 최근에 열의 이름을 for_search에서 address_lookup으로 바 꾸었습니다. Shop 모델의 열은 address_lookup이고 CountryShop 모델과 연결되어 있습니다. 열 이름을 바꿉니다. 그러나 ThinkingSphinx :: SphinxError : 알 수없는 열 : 'shop_address_lookup'

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

내가 development.sphinx.conf을 제거하고 ts:regenerate을 실행 :

여기 내 Country 인덱스입니다. 인덱싱 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 
........