sunspot/sunspot — pull request #462 by bradcater (2013-09-09 01:49:14+00:00)
Title: Reindex if :auto_save => true only if indexed fields have changed.

By default, :auto_index => true will cause sunspot_rails to reindex an instance even if its indexed fields have not changed. There is an undocumented option :only_reindex_attribute_changes_of that can be found in lib/sunspot/rails/searchable.rb that will cause Sunspot to reindex the instance only if the given fields have changed. Instead of manually listing all of the fields both in the searchable block and in the searchable options, it makes more sense to check the searchable fields and put them in :only_reindex_attribute_changes_of if :only_reindex_attribute_changes_of is not otherwise specified.