Created
March 27, 2015 11:01
-
-
Save joost/6362c2f4ec388b91380b to your computer and use it in GitHub Desktop.
Sunspot reindex without removing the index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class YourModel | |
# Overwrite sunspot version to not remove from index. | |
# See: https://github.com/sunspot/sunspot/blob/16e5f620814fd4bdf43e3df158e7fdcbbd92713b/sunspot_rails/lib/sunspot/rails/searchable.rb#L206 | |
def self.solr_reindex(options = {}) | |
solr_index(options) | |
solr_clean_index_orphans | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment