0
使用Rails 4,Thinking Sphinx 3.2.0。我最近將一列從for_search
更名爲address_lookup
。 Shop
型號的列爲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
而不更改實際列名稱時,索引正常工作。