如何限制发送给Algolia的记录?

时间:2015-06-23 16:46:48

标签: ruby-on-rails ruby algolia

在Ruby on Rails中使用Algolia,我可以轻松索引模型:

class Service < ActiveRecord::Base
  include AlgoliaSearch

  algoliasearch per_environment: true do
    attributesToIndex ['name', 'canonical_url']
    attributes ['name', 'canonical_url]
    add_attribute :type do
      "Service"
    end
  end
end

有没有办法限制我要发送的Service

例如:Only index Services where name != nil

1 个答案:

答案 0 :(得分:3)