ThinkingSphinx :: MissingColumnError:列<name>不存在</name>

时间:2014-11-05 21:18:25

标签: mysql thinking-sphinx

我今天还有另一个TS问题。

rake ts:index

返回类似这样的内容:

Generating configuration to /Users/xxx/config/development.sphinx.conf
rake aborted!
ThinkingSphinx::MissingColumnError: column amplua does not exist
/Library/Ruby/Gems/2.0.0/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/attribute/type.rb:74:in `type_from_database'
/Library/Ruby/Gems/2.0.0/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/attribute/type.rb:17:in `type'
<and so on...>

只要我明白了:Sphinx无法找到专栏&amp; amp; amp;即使它存在。这是&#34; ampluas&#34;来自mysql查询的表表示:

mysql> show tables
    -> ;
+----------------------------+
| Tables_in_xxx              |
+----------------------------+
| ampluas                    |
| yyyyyyy                    |
| zzzzzzzzzzzz               |
+----------------------------+
<n> rows in set (0.09 sec)

mysql> describe ampluas;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| name       | varchar(255) | YES  |     | NULL    |                |
| created_at | datetime     | YES  |     | NULL    |                |
| updated_at | datetime     | YES  |     | NULL    |                |
+------------+--------------+------+-----+---------+----------------+
4 rows in set (0.01 sec)

amplua_index.rb:

ThinkingSphinx::Index.define :amplua, :with => :active_record do

    indexes :name, :as => :ampluas

end

它有什么用?

0 个答案:

没有答案