acts_as_sphinx.rb第14行:
[code]
default_options = {:host => 'localhost', :port => 3312, :index => name.tableize}
[/code]
这里查询的index名字直接用了name.tableize,没有考虑使用set_table_name来设置一些遗留数据库表的情况,所以应该改为:
[code]
default_options = {:host => 'localhost', :port => 3312, :index => table_name || name.tableize}
[/code]
[code]
default_options = {:host => 'localhost', :port => 3312, :index => name.tableize}
[/code]
这里查询的index名字直接用了name.tableize,没有考虑使用set_table_name来设置一些遗留数据库表的情况,所以应该改为:
[code]
default_options = {:host => 'localhost', :port => 3312, :index => table_name || name.tableize}
[/code]