【问题标题】:Rails - Sunspot conditional model indexingRails - 太阳黑子条件模型索引
【发布时间】:2011-07-05 19:58:31
【问题描述】:

有什么方法可以在运行时确定模型是否应该被索引?比如:

class Article < ActiveRecord::Base

  searchable :if => :indexable? do 
    ...
  end

  private
  def indexable?
    ...
  end

end

【问题讨论】:

    标签: ruby-on-rails lucene full-text-search sunspot sunspot-rails


    【解决方案1】:

    这是一篇关于条件索引的好文章:http://mikepackdev.com/blog_posts/19-conditional-indexing-with-sunspot

    也就是说,正是您在问题中提出的 API。

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-09-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多