Method: Sunspot::Rails::Searchable::ClassMethods#solr_clean_index_orphans
- Defined in:
- lib/sunspot/rails/searchable.rb
#solr_clean_index_orphans ⇒ Object
Find IDs of records of this class that are indexed in Solr but do not exist in the database, and remove them from Solr. Under normal circumstances, this should not be necessary; this method is provided in case something goes wrong.
273 274 275 276 277 278 279 |
# File 'lib/sunspot/rails/searchable.rb', line 273 def solr_clean_index_orphans solr_index_orphans.each do |id| new do |fake_instance| fake_instance.id = id end.solr_remove_from_index end end |