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,7 +48,7 @@ module Searchkick | ||
48 | class ImportError < Error; end | 48 | class ImportError < Error; end |
49 | 49 | ||
50 | class << self | 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 | attr_writer :client, :env, :search_timeout | 52 | attr_writer :client, :env, :search_timeout |
53 | attr_reader :aws_credentials | 53 | attr_reader :aws_credentials |
54 | end | 54 | end |
@@ -58,6 +58,7 @@ module Searchkick | @@ -58,6 +58,7 @@ module Searchkick | ||
58 | self.models = [] | 58 | self.models = [] |
59 | self.client_options = {} | 59 | self.client_options = {} |
60 | self.queue_name = :searchkick | 60 | self.queue_name = :searchkick |
61 | + self.model_options = {} | ||
61 | 62 | ||
62 | def self.client | 63 | def self.client |
63 | @client ||= begin | 64 | @client ||= begin |
lib/searchkick/model.rb
1 | module Searchkick | 1 | module Searchkick |
2 | module Model | 2 | module Model |
3 | def searchkick(**options) | 3 | def searchkick(**options) |
4 | + options = Searchkick.model_options.merge(options) | ||
5 | + | ||
4 | unknown_keywords = options.keys - [:_all, :_type, :batch_size, :callbacks, :conversions, :default_fields, | 6 | unknown_keywords = options.keys - [:_all, :_type, :batch_size, :callbacks, :conversions, :default_fields, |
5 | :filterable, :geo_shape, :highlight, :ignore_above, :index_name, :index_prefix, :inheritance, :language, | 7 | :filterable, :geo_shape, :highlight, :ignore_above, :index_name, :index_prefix, :inheritance, :language, |
6 | :locations, :mappings, :match, :merge_mappings, :routing, :searchable, :settings, :similarity, | 8 | :locations, :mappings, :match, :merge_mappings, :routing, :searchable, :settings, :similarity, |