SunspotはModelを変更すると毎回Reindexしますが、検索に利用しないattribute
を変更したときにReindexされると、無駄なコストが発生します。
変更を無視して、Reindexしないようにするオプションが用意されています。
ignore.rb
searchable :ignore_attribute_changes_of => [:favorites_count, :updated_at] do
text :title
text :description
end
これでfavorites_count
やupdated_at
が変更されてもReindexが行われません。