Commit 00e3ec9e306aefc41042133922f1f3f8ebd7b7f7
1 parent
d2a89c65
Exists in
master
and in
19 other branches
Added model_options [skip ci]
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
lib/searchkick.rb
... | ... | @@ -48,7 +48,7 @@ module Searchkick |
48 | 48 | class ImportError < Error; end |
49 | 49 | |
50 | 50 | class << self |
51 | - attr_accessor :search_method_name, :wordnet_path, :timeout, :models, :client_options, :redis, :index_prefix, :index_suffix, :queue_name | |
51 | + attr_accessor :search_method_name, :wordnet_path, :timeout, :models, :client_options, :redis, :index_prefix, :index_suffix, :queue_name, :model_options | |
52 | 52 | attr_writer :client, :env, :search_timeout |
53 | 53 | attr_reader :aws_credentials |
54 | 54 | end |
... | ... | @@ -58,6 +58,7 @@ module Searchkick |
58 | 58 | self.models = [] |
59 | 59 | self.client_options = {} |
60 | 60 | self.queue_name = :searchkick |
61 | + self.model_options = {} | |
61 | 62 | |
62 | 63 | def self.client |
63 | 64 | @client ||= begin | ... | ... |
lib/searchkick/model.rb
1 | 1 | module Searchkick |
2 | 2 | module Model |
3 | 3 | def searchkick(**options) |
4 | + options = Searchkick.model_options.merge(options) | |
5 | + | |
4 | 6 | unknown_keywords = options.keys - [:_all, :_type, :batch_size, :callbacks, :conversions, :default_fields, |
5 | 7 | :filterable, :geo_shape, :highlight, :ignore_above, :index_name, :index_prefix, :inheritance, :language, |
6 | 8 | :locations, :mappings, :match, :merge_mappings, :routing, :searchable, :settings, :similarity, | ... | ... |