Commit 642ec5190da4e4c61281112c798efe076035bae8

Authored by Andrew Kane
1 parent 0e98b154

Warn for unsupported keywords - #1391

Showing 2 changed files with 12 additions and 0 deletions   Show diff stats
lib/searchkick/index.rb
... ... @@ -187,11 +187,17 @@ module Searchkick
187 187 options.delete(:refresh)
188 188  
189 189 if method_name
  190 + # TODO throw ArgumentError
  191 + Searchkick.warn("unsupported keywords: #{options.keys.map(&:inspect).join(", ")}") if options.any?
  192 +
190 193 # update
191 194 import_scope(relation, method_name: method_name, scope: scope)
192 195 self.refresh if refresh
193 196 true
194 197 elsif scoped && !full
  198 + # TODO throw ArgumentError
  199 + Searchkick.warn("unsupported keywords: #{options.keys.map(&:inspect).join(", ")}") if options.any?
  200 +
195 201 # reindex association
196 202 import_scope(relation, scope: scope)
197 203 self.refresh if refresh
... ...
test/reindex_test.rb
... ... @@ -92,4 +92,10 @@ class ReindexTest < Minitest::Test
92 92 def test_refresh_full_reindex
93 93 Product.reindex(refresh: true)
94 94 end
  95 +
  96 + def test_partial_async
  97 + store_names ["Product A"]
  98 + # warn for now
  99 + Product.reindex(:search_name, async: true)
  100 + end
95 101 end
... ...