在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
答案 0 :(得分:3)