Is there any way to determine on runtime if a model should be indexed or not? Something like:
class Article < ActiveRecord::Base
searchable :if => :indexable? do
...
end
private
def indexable?
...
end
end
Is there any way to determine on runtime if a model should be indexed or not? Something like:
class Article < ActiveRecord::Base
searchable :if => :indexable? do
...
end
private
def indexable?
...
end
end
Answered here
Here's a good article on conditional indexing: http://mikepackdev.com/blog_posts/19-conditional-indexing-with-sunspot
That is, exactly the API you propose in your question.