我使用 TS 同时搜索 2 个模型(类):
class Product < ActiveRecord::Base
belongs_to :user
belongs_to :photo
has_many :variants
end
class Article < ActiveRecord::Base
belongs_to :user
belongs_to :photo
end
在控制器中:
@item_facets = ThinkingSphinx.facets( options[:search],
:classes => [Product, Article],
:include => [:user, :photo])
@items = @items_facets.for
是否有可能以某种方式使用急切加载:variants
?