Commit bfe5dd1a33b701e53f650af634cb119a81ea9e17

Authored by Andrew Kane
1 parent b6694113

Improved naming and code [skip ci]

Showing 1 changed file with 4 additions and 5 deletions   Show diff stats
lib/searchkick/index.rb
... ... @@ -209,7 +209,7 @@ module Searchkick
209 209  
210 210 # reindex
211 211  
212   - def reindex(relation, method_name, scoped:, full: false, scope: nil, **options)
  212 + def reindex(relation, method_name, scoped:, full: false, **options)
213 213 refresh = options.fetch(:refresh, !scoped)
214 214 options.delete(:refresh)
215 215  
... ... @@ -218,12 +218,11 @@ module Searchkick
218 218 raise ArgumentError, "unsupported keywords: #{options.keys.map(&:inspect).join(", ")}" if options.any?
219 219  
220 220 # import only
221   - import_scope(relation, method_name: method_name, scope: scope, mode: mode)
  221 + import_scope(relation, method_name: method_name, mode: mode)
222 222 self.refresh if refresh
223 223 true
224 224 else
225   - # full reindex
226   - reindex_scope(relation, scope: scope, **options)
  225 + full_reindex(relation, **options)
227 226 end
228 227 end
229 228  
... ... @@ -317,7 +316,7 @@ module Searchkick
317 316 # https://gist.github.com/jarosan/3124884
318 317 # http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/
319 318 # TODO deprecate async in favor of mode: :async, wait: true/false
320   - def reindex_scope(relation, import: true, resume: false, retain: false, async: false, refresh_interval: nil, scope: nil)
  319 + def full_reindex(relation, import: true, resume: false, retain: false, async: false, refresh_interval: nil, scope: nil)
321 320 if resume
322 321 index_name = all_indices.sort.last
323 322 raise Searchkick::Error, "No index to resume" unless index_name
... ...