Is there a way to determine at runtime if a model should be indexed or not? Sort of:
class Article < ActiveRecord::Base searchable :if => :indexable? do ... end private def indexable? ... end end
Answer here
Exclude articles from Solr index using Sunspot
Here's a good article on conditional indexing: http://mikepackdev.com/blog_posts/19-conditional-indexing-with-sunspot
That is exactly the API that you offer in your question.
Source: https://habr.com/ru/post/1341659/More articles:Launch another application using AppleScript without showing it on the dock - hideIs it possible to extend AR relationships? - activerecordquestion mark inside C # syntax - c #How to select a set of unique random numbers (without duplicates) using the jQuery.inArray method? - javascriptwhat is this strange syntax in C # bytes * - pointersHow to convert this date format to php? - dateBourne shell version - shGood behavior for energetically loading a few siblings and grandchildren (cousins?) NHibernate 3.0 Linq - performanceEntity Framework - View or attach a database in Linq to objects - c #What can cause damage to my WP7 application only on some models? - windows-phone-7All Articles