From ea4fa035614794ed829e44a035979b239f1c41d3 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 8 Mar 2016 07:43:36 +0100 Subject: [PATCH] Fixed Model.search_index_reload, support ignore_ids. --- app/models/application_model.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/application_model.rb b/app/models/application_model.rb index cc52f1aca..eefa7ef27 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -800,9 +800,11 @@ reload search index with full data =end def self.search_index_reload - return if !@search_index_support_config + config = @search_index_support_config + return if !config all_ids = select('id').all.order('created_at DESC') all_ids.each { |item_with_id| + next if config[:ignore_ids] && config[:ignore_ids].include?(item_with_id.id) item = find(item_with_id.id) item.search_index_update_backend }