4
有什么方法可以确定运行时模型是否应该被索引?喜欢的东西:Rails - 太阳黑子条件模型索引
class Article < ActiveRecord::Base
searchable :if => :indexable? do
...
end
private
def indexable?
...
end
end
有什么方法可以确定运行时模型是否应该被索引?喜欢的东西:Rails - 太阳黑子条件模型索引
class Article < ActiveRecord::Base
searchable :if => :indexable? do
...
end
private
def indexable?
...
end
end
回答下面是有条件索引的好文章:http://mikepackdev.com/blog_posts/19-conditional-indexing-with-sunspot
也就是说,正是你在你的问题提出了API。